mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemuBackupDiskDataCleanupOne: Don't exit early when the job has started
Originally the function was cleaning up a failed job only but now there's other stuff that needs to be cleared too. Make only steps which clean up after a failed job depend on the 'started' field and execute the rest of the code always. This fixes a leak of the backup job tracking object and the blockdev-add helper data. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
214faa0b04
commit
165b430eb9
@ -124,9 +124,7 @@ qemuBackupDiskDataCleanupOne(virDomainObjPtr vm,
|
|||||||
{
|
{
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
|
|
||||||
if (dd->started)
|
if (!dd->started) {
|
||||||
return;
|
|
||||||
|
|
||||||
if (dd->added) {
|
if (dd->added) {
|
||||||
qemuDomainObjEnterMonitor(priv->driver, vm);
|
qemuDomainObjEnterMonitor(priv->driver, vm);
|
||||||
qemuBlockStorageSourceAttachRollback(priv->mon, dd->crdata->srcdata[0]);
|
qemuBlockStorageSourceAttachRollback(priv->mon, dd->crdata->srcdata[0]);
|
||||||
@ -138,11 +136,12 @@ qemuBackupDiskDataCleanupOne(virDomainObjPtr vm,
|
|||||||
VIR_WARN("Unable to remove just-created %s", NULLSTR(dd->store->path));
|
VIR_WARN("Unable to remove just-created %s", NULLSTR(dd->store->path));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dd->initialized)
|
|
||||||
virStorageFileDeinit(dd->store);
|
|
||||||
|
|
||||||
if (dd->labelled)
|
if (dd->labelled)
|
||||||
qemuDomainStorageSourceAccessRevoke(priv->driver, vm, dd->store);
|
qemuDomainStorageSourceAccessRevoke(priv->driver, vm, dd->store);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dd->initialized)
|
||||||
|
virStorageFileDeinit(dd->store);
|
||||||
|
|
||||||
if (dd->blockjob)
|
if (dd->blockjob)
|
||||||
qemuBlockJobStartupFinalize(vm, dd->blockjob);
|
qemuBlockJobStartupFinalize(vm, dd->blockjob);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user