mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
qemu: Fix depedency order in qemuRemoveDiskDevice
Need to remove the drive first, then the secobj and/or encobj if they exist. This is because the drive has a dependency on secobj (or the secret for the networked storage server) and/or the encobj (or the secret for the LUKS encrypted volume). Deleting either object first leaves an drive without it's respective objects. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
13022ce430
commit
502c747aa1
@ -3176,6 +3176,9 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
|
||||
qemuMonitorDriveDel(priv->mon, drivestr);
|
||||
VIR_FREE(drivestr);
|
||||
|
||||
/* If it fails, then so be it - it was a best shot */
|
||||
if (objAlias)
|
||||
ignore_value(qemuMonitorDelObject(priv->mon, objAlias));
|
||||
@ -3186,8 +3189,6 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
|
||||
ignore_value(qemuMonitorDelObject(priv->mon, encAlias));
|
||||
VIR_FREE(encAlias);
|
||||
|
||||
qemuMonitorDriveDel(priv->mon, drivestr);
|
||||
VIR_FREE(drivestr);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||
return -1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user