]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: fix return value issue in qemuDomainSetMemoryParameters
authorAlex Jia <ajia@redhat.com>
Mon, 1 Aug 2011 15:06:07 +0000 (23:06 +0800)
committerEric Blake <eblake@redhat.com>
Mon, 1 Aug 2011 15:21:33 +0000 (09:21 -0600)
commit868453db1ebcc8e7b2e17e8ae99a207ca880530e
tree48663a50811476d9ecb904cde181c7655f818317
parentc9ee3d26750c445c81f5a39f8a0fb5fe8651f26a
qemu: fix return value issue in qemuDomainSetMemoryParameters

whether or not previous return value is -1, the following codes will be
executed for a inactive guest in qemuDomainSetMemoryParameters:
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 set
  min_guarante value to a inactive guest.

* how to reproduce?
  % virsh memtune ${guestname} --min_guarante 1024
  % echo $?

  Note: guest must be inactive, in fact, 'min_guarante' hasn't been implemented
  in memory tunable, and I can get the error when check actual libvirtd.log,
  however, virsh hasn't raised any error information, and return value is 0.

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