[vbox-dev] Question about VirtualBox SDK-regarding about SetIOBandwidthMax();

Klaus Espenlaub klaus.espenlaub at oracle.com
Fri Dec 3 12:56:39 GMT 2010


On 03.12.2010 03:00, John Lee wrote:
> Hello,
>
> I'm trying to use the function SetIOBandwidthMax within the VirtualBox
> SDK 3.2.0. Somehow, I'm having a problem with making it work. I'm trying
> to set a maximum bandwidth of the VM to 1Mbps to test network throughput
> for the VM.
>
> The code that I wrote is the following:
>
> IMachine* machine1;
> rc=machine1->vtbl->SetIoBandwidthMax(machine1.machine,temp);//where the
> temp val is set to 1.
>
> But when I'm getting the rc value, it comes out as not successful.

Would really help if you'd give the rc value, and preferrable the 
detailed error information as well (that's why we have the 
IVirtualBoxErrorInfo interface...)

> Could you help me with this problem?
> Thank you for your help in advance.

With the available information I can only guess that you're trying to 
modify the Machine object directly. This isn't possible, you must open a 
session so that the changing of settings is properly synchronized. Also 
you need to save the settings before closing the session, otherwise all 
changes are lost.

Besides, I don't understand how you come to the conclusion that this API 
method allows you to control the network bandwidth. It only affects the 
disk bandwidth...

In VirtualBox 4.0 the API design includes network bandwidth control, 
however that's not implemented yet.

Klaus

>
> Sincerely,
> John Lee
>
>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev




More information about the vbox-dev mailing list