]> xenbits.xensource.com Git - libvirt.git/commit
qemu: amend existing table of device weights
authorEric Blake <eblake@redhat.com>
Tue, 29 Nov 2011 21:00:17 +0000 (14:00 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 30 Nov 2011 19:18:18 +0000 (12:18 -0700)
commit22cf6d46f444573aafcc977b466253ec9b42cd13
treea2a60ebb9096dce7cae42f50fa08edee18900b71
parent9b524ff0404de655654cd610f8886ea220b59b96
qemu: amend existing table of device weights

Prior to this patch, for a running dom, the commands:

$ virsh blkiotune dom --device-weights /dev/sda,502,/dev/sdb,498
$ virsh blkiotune dom --device-weights /dev/sda,503
$ virsh blkiotune dom
weight         : 500
device_weight  : /dev/sda,503

claim that /dev/sdb no longer has a non-default weight, but
directly querying cgroups says otherwise:

$ cat /cgroup/blkio/libvirt/qemu/dom/blkio.weight_device
8:0     503
8:16    498

After this patch, an explicit 0 is required to remove a device path
from the XML, and omitting a device path that was previously
specified leaves that device path untouched in the XML, to match
cgroups behavior.

* src/qemu/qemu_driver.c (parseBlkioWeightDeviceStr): Rename...
(qemuDomainParseDeviceWeightStr): ...and use correct type.
(qemuDomainSetBlkioParameters): After parsing string, modify
rather than replacing existing table.
* tools/virsh.pod (blkiotune): Tweak wording.
src/qemu/qemu_driver.c
tools/virsh.pod