Re: [PATCH 04/11] Fix vm usage after ExitMonitor on device removal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16.12.2014 17:41, Ján Tomko wrote:
In the device type-specific functions, exit early
if the domain has disappeared, because the cleanup
should have been done by qemuProcessStop.

In processDeviceDeletedEvent, only save status XML if the domain
is still running and exit early in qemuProcessUpdateDevices
if the domain disappeared.
---
  src/qemu/qemu_driver.c  |  3 ++-
  src/qemu/qemu_hotplug.c | 18 ++++++++++++------
  src/qemu/qemu_process.c |  2 ++
  3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 99eb7c3..07b061e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4112,7 +4112,8 @@ processDeviceDeletedEvent(virQEMUDriverPtr driver,

      qemuDomainRemoveDevice(driver, vm, &dev);

-    if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
+    if (virDomainObjIsActive(vm) &&
+        virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)

Can we rather make qemuDomainRemoveDevice() return -1 on error and check for that in callers? That way we will fix even case when the function is called with unsupported device. ACK to the rest of the patch, though.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]