]> xenbits.xensource.com Git - libvirt.git/commit
qemu: fix return value issue
authorAlex Jia <ajia@redhat.com>
Mon, 1 Aug 2011 15:45:27 +0000 (23:45 +0800)
committerEric Blake <eblake@redhat.com>
Mon, 1 Aug 2011 15:40:13 +0000 (09:40 -0600)
commitc03f7f1358a47e3bcc1575972c984233ca5da77c
tree25c7175c88180e3c733f1bafa98975162b68b822
parent868453db1ebcc8e7b2e17e8ae99a207ca880530e
qemu: fix return value issue

whether or not previous return value is -1, the following codes will be
executed for a inactive guest in src/qemu/qemu_driver.c:
ret = virDomainSaveConfig(driver->configDir, persistentDef);
and if everything is okay, 'ret' is assigned to 0, the previous 'ret'
will be overwritten, this patch will fix this issue.

* src/qemu/qemu_driver.c: avoid return value is overwritten when give a argument
  in out of blkio weight range for a inactive guest.

* how to reproduce?
  % virsh blkiotune ${guestname} --weight 10
  % echo $?

  Note: guest must be inactive, argument 10 in out of blkio weight range,
  and can get a error information by checking libvirtd.log, however,
  virsh hasn't raised any error information, and return value is 0.

  https://bugzilla.redhat.com/show_bug.cgi?id=726304

Signed-off-by: Alex Jia <ajia@redhat.com>
src/qemu/qemu_driver.c