[libvirt] guest band width setting

Michal Privoznik mprivozn at redhat.com
Mon Mar 31 14:18:35 UTC 2014


On 30.03.2014 14:46, Pradeep Kiruvale wrote:
> Hi All,
>
>   I am new to QEMU/libvirt
>
>    I was starting to learn the libvirt code,I was browsing  the code how
> the guest network bandwidth to be set like we mention <inbound> <outbound>
> tags in the xml,but where in code exactly these values set to the guest
> interface.
>
> I browsed the code a lot could not find it.Please help to understand how
> this works.
>
>

The bandwidth is set in virNetDevBandwidthSet() function:

http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/util/virnetdevbandwidth.c;h=b06ed4c63c1e64736718b880b1821d745d7f31c2;hb=HEAD#l60

The basic idea is to call /sbin/tc a few times with the correct 
arguments (the path to the binary may change through different systems).

Michal




More information about the libvir-list mailing list