qemuBlockJobRefreshJobs: Replace qemuMonitorJobCancel by qemuMonitorBlockJobCancel

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>
This commit is contained in:
Peter Krempa 2021-04-20 16:34:02 +02:00
parent c83d7775cb
commit 5d31f5e7a7

View 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);