]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix handling of blkio deviceWeight empty string
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 16 Mar 2012 11:05:31 +0000 (11:05 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 16 Mar 2012 15:05:05 +0000 (15:05 +0000)
commitf987d17511a47b48c0652f1c6aecabda6fb07e8f
treeb88d5ac713d22e25d84c49d22a954c5d7a3fe75e
parentb569c1abc118150e45f69abb423d76f8e8ecf97c
Fix handling of blkio deviceWeight empty string

A common coding pattern for changing blkio parameters is

  1. virDomainGetBlkioParameters

  2. change one or more params

  3. virDomainSetBlkioParameters

For this to work, it must be possible to roundtrip through
the methods without error. Unfortunately virDomainGetBlkioParameters
will return "" for the deviceWeight parameter for guests by default,
which virDomainSetBlkioParameters will then reject as invalid.

This fixes the handling of "" to be a no-op, and also improves the
error message to tell you what was invalid
src/qemu/qemu_driver.c