mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemu: Move interlocking of blockjobs and checkpoints after liveness check
qemuDomainSupportsCheckpointsBlockjobs checks if the QEMU_CAPS_INCREMENTAL_BACKUP capability is supported to do the interlocking. Capabilities are not present when the VM isn't running though which would create false errors. Move the checks after the liveness check in block job implementations. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Pavel Mores <pmores@redhat.com>
This commit is contained in:
parent
b37fdfb9d4
commit
bef10f6eaa
@ -17440,6 +17440,9 @@ qemuDomainBlockPullCommon(virDomainObjPtr vm,
|
||||
if (virDomainObjCheckActive(vm) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (!(disk = qemuDomainDiskByName(vm->def, path)))
|
||||
goto endjob;
|
||||
|
||||
@ -17995,6 +17998,9 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
|
||||
if (virDomainObjCheckActive(vm) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (!(disk = qemuDomainDiskByName(vm->def, path)))
|
||||
goto endjob;
|
||||
|
||||
@ -18279,9 +18285,6 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base,
|
||||
if (virDomainBlockRebaseEnsureACL(dom->conn, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
/* For normal rebase (enhanced blockpull), the common code handles
|
||||
* everything, including vm cleanup. */
|
||||
if (!(flags & VIR_DOMAIN_BLOCK_REBASE_COPY))
|
||||
@ -18365,9 +18368,6 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *disk, const char *destxml,
|
||||
if (virDomainBlockCopyEnsureACL(dom->conn, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
for (i = 0; i < nparams; i++) {
|
||||
virTypedParameterPtr param = ¶ms[i];
|
||||
|
||||
@ -18430,11 +18430,6 @@ qemuDomainBlockPull(virDomainPtr dom, const char *path, unsigned long bandwidth,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0) {
|
||||
virDomainObjEndAPI(&vm);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* qemuDomainBlockPullCommon consumes the reference on @vm */
|
||||
return qemuDomainBlockPullCommon(vm, path, NULL, bandwidth, flags);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user