
On 01/13/2015 12:54 AM, John Ferlan wrote:
On 01/07/2015 10:42 AM, Ján Tomko wrote:
Error out if the domain has disappeared in the meantime.
This prevents writing the persistent definition as the domain status and calling qemuDomainRemoveDevice on devices that already have been dealt with in qemuProcessStop. --- src/qemu/qemu_domain.c | 9 +++++---- src/qemu/qemu_driver.c | 4 ++-- src/qemu/qemu_hotplug.c | 38 +++++++++++++++++++------------------- 3 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index a4e4d6b..6b108bf 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -193,7 +193,8 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
qemuDomainObjEnterMonitor(driver, vm); ret = qemuMonitorEjectMedia(priv->mon, driveAlias, force); - qemuDomainObjExitMonitor(driver, vm); + if (qemuDomainObjExitMonitor(driver, vm) < 0) + goto cleanup;
if "ret == 0" we get to cleanup... with ejected media, no Audit and the rest of this not done...
I've added ret = -1 in front of that. Both audit and qemuDomainPrepareDisk on the error path would need access to the disk that's now freed. Jan