mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
qemu: hotplug: Remove rest of source backend if hotplug fails
When changing media using blockdev-add we need to remove the leftovers if we didn't succeed plugging in the full chain or closing the tray. Otherwise the data structures will be freed and thus the backing chain members will never be unplugged. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
9237a81c13
commit
04c7fc0809
@ -491,6 +491,9 @@ qemuDomainChangeMediaBlockdev(virQEMUDriverPtr driver,
|
|||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
rc = qemuMonitorBlockdevTrayClose(priv->mon, diskPriv->qomName);
|
rc = qemuMonitorBlockdevTrayClose(priv->mon, diskPriv->qomName);
|
||||||
|
|
||||||
|
if (rc < 0 && newbackend)
|
||||||
|
qemuBlockStorageSourceChainDetach(priv->mon, newbackend);
|
||||||
|
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user