]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainBlockJobAbort: Don't use 'job-cancel' instead of 'block-job-cancel'
authorPeter Krempa <pkrempa@redhat.com>
Wed, 21 Apr 2021 13:47:59 +0000 (15:47 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 26 Apr 2021 15:22:52 +0000 (17:22 +0200)
'block-job-cancel' has one very important semantic difference to
'job-cancel', docummented in qemu as:

  Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
  (via the event BLOCK_JOB_READY) that the source and destination are
  synchronized, then the event triggered by this command changes to
  BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
  destination now has a point-in-time copy tied to the time of the cancellation.

Since libvirt advertises the block copy job as having the synchronous
abort feature we must not use 'job-cancel' here.

Fixes: 4817b5ca1d0
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_driver.c

index 7a9ad034896d8098662984d4d0500d8f003440f3..c90d52edc037acf9d09f616524e273802b4ff7e0 100644 (file)
@@ -14461,7 +14461,6 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
     g_autoptr(qemuBlockJobData) job = NULL;
     virDomainObj *vm;
     qemuDomainObjPrivate *priv = NULL;
-    bool blockdev = false;
     int ret = -1;
 
     virCheckFlags(VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC |
@@ -14489,7 +14488,6 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
     }
 
     priv = vm->privateData;
-    blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);
 
     if (job->state == QEMU_BLOCKJOB_STATE_ABORTING ||
         job->state == QEMU_BLOCKJOB_STATE_PIVOTING) {
@@ -14507,10 +14505,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
             goto endjob;
     } else {
         qemuDomainObjEnterMonitor(driver, vm);
-        if (blockdev)
-            ret = qemuMonitorJobCancel(priv->mon, job->name, false);
-        else
-            ret = qemuMonitorBlockJobCancel(priv->mon, job->name, false);
+        ret = qemuMonitorBlockJobCancel(priv->mon, job->name, false);
         if (qemuDomainObjExitMonitor(driver, vm) < 0) {
             ret = -1;
             goto endjob;