qemu: blockjob: Actually delete temporary bitmap on failed active commit

Commit 20a7abc2d2d tried to delete the possibly leftover bitmap but
neglected to call the actual monitor to do so.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Peter Krempa 2020-07-16 15:19:25 +02:00
parent d73f107469
commit 378e4fbc79

View File

@ -1416,8 +1416,10 @@ qemuBlockJobProcessEventConcludedCopyAbort(virQEMUDriverPtr driver,
static void
qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuBlockJobDataPtr job)
qemuBlockJobDataPtr job,
qemuDomainAsyncJob asyncJob)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
g_autoptr(virJSONValue) actions = virJSONValueNewArray();
virDomainDiskDefPtr disk = job->disk;
@ -1429,6 +1431,13 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriverPtr driver,
ignore_value(qemuMonitorTransactionBitmapRemove(actions, disk->mirror->nodeformat,
"libvirt-tmp-activewrite"));
if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0)
return;
qemuMonitorTransaction(priv->mon, &actions);
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0)
return;
/* Ideally, we would make the backing chain read only again (yes, SELinux
* can do that using different labels). But that is not implemented yet and
@ -1553,7 +1562,7 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job,
if (success) {
qemuBlockJobProcessEventCompletedActiveCommit(driver, vm, job, asyncJob);
} else {
qemuBlockJobProcessEventFailedActiveCommit(driver, vm, job);
qemuBlockJobProcessEventFailedActiveCommit(driver, vm, job, asyncJob);
}
break;