mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-27 08:05:24 +00:00
1dd34bbb4b
The xen sexpr config format has long supported specifying vif rate limiting, e.g. (device (vif (mac '00:16:3e:1b:b1:47') (rate '10240KB/s') ... ) ) Add support for mapping rate to and from <bandwidth> in the xenconfig sexpr parser and formatter. rate is mapped to the required 'average' attribute of the <outbound> element, e.g. <interface type='bridge'> ... <bandwidth> <outbound average='10240'/> </bandwidth> </interface> Also add unit tests to check the conversion logic. This patch benefits both the old xen driver and the libxl driver. Both drivers gain support for vif bandwidth when converting to/from domXML and xen-sxpr. In addition, the old xen driver will now be able to handle vif 'rate' setting when communicating with xend.
12 lines
575 B
Plaintext
12 lines
575 B
Plaintext
(domain (domid 3)(name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)\
|
|
(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')\
|
|
(on_reboot 'restart')(on_crash 'restart')\
|
|
(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')\
|
|
(device_model '/usr/lib64/xen/bin/qemu-dm')(boot c)\
|
|
(acpi 1)(vnc 1)(keymap ja)))(device (vbd (dev 'ioemu:hda')\
|
|
(uname 'file:/root/foo.img')(mode 'w')))\
|
|
(device (vbd (dev 'hdc:cdrom')\
|
|
(uname 'file:/root/boot.iso')(mode 'r')))\
|
|
(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')\
|
|
(script 'vif-bridge')(type 'netfront')(rate '10240KB/s'))))
|