• E
    qemu: amend existing table of device weights · 22cf6d46
    Eric Blake 提交于
    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.
    22cf6d46
qemu_driver.c 365.0 KB