]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuBlockJobRefreshJobs: Replace qemuMonitorJobCancel by qemuMonitorBlockJobCancel
authorPeter Krempa <pkrempa@redhat.com>
Tue, 20 Apr 2021 14:34:02 +0000 (16:34 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 26 Apr 2021 15:22:52 +0000 (17:22 +0200)
We want to unify on one block job cancellation API. Use
qemuMonitorBlockJobCancel which has more features.

In case of job refresh, we are killing off any unknown jobs so we don't
care about their fate.

Another difference is that an possible error from the block job
cancellation might be reported, but we don't really care here ince
it's a very unlikely scenario and we also report a warning.

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

index 9ae4500f4d4e7889c93514cb1a44c1ec7d91849f..faf9a9fb7d8313d6a93c4be17f6ac1f1b74c1098 100644 (file)
@@ -526,7 +526,7 @@ qemuBlockJobRefreshJobs(virQEMUDriver *driver,
 
             qemuDomainObjEnterMonitor(driver, vm);
 
-            rc = qemuMonitorJobCancel(priv->mon, job->name, true);
+            rc = qemuMonitorBlockJobCancel(priv->mon, job->name, true);
             if (rc == -1 && jobinfo[i]->status == QEMU_MONITOR_JOB_STATUS_CONCLUDED)
                 VIR_WARN("can't cancel job '%s' with invalid data", job->name);