Since capabilities are not present for inactive VMs we'd report that we
don't support '--delete' or commiting while checkpoints exist rather
than the proper error.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_driver.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d565054436..d3eb2171ef 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18413,9 +18413,6 @@ qemuDomainBlockCommit(virDomainPtr dom,
if (virDomainBlockCommitEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0)
- goto cleanup;
-
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
@@ -18424,12 +18421,6 @@ qemuDomainBlockCommit(virDomainPtr dom,
blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
- if (!blockdev && (flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE)) {
- virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
- _("deleting committed images is not supported by this
VM"));
- goto endjob;
- }
-
/* Convert bandwidth MiB to bytes, if necessary */
if (!(flags & VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES)) {
if (speed > LLONG_MAX >> 20) {
@@ -18454,6 +18445,15 @@ qemuDomainBlockCommit(virDomainPtr dom,
if (qemuDomainDiskBlockJobIsActive(disk))
goto endjob;
+ if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0)
+ goto endjob;
+
+ if (!blockdev && (flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE)) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("deleting committed images is not supported by this
VM"));
+ goto endjob;
+ }
+
if (!top || STREQ(top, disk->dst))
topSource = disk->src;
else if (virStorageFileParseChainIndex(disk->dst, top, &topIndex) < 0 ||
--
2.24.1