qemu: processBlockJobEvent: Use qemuBlockJobUpdate to process block job events

Replace use of qemuBlockJobEventProcess with the general helper. A small
tweak is required to pass in the 'type' and 'status' of the job via the
appropriate private data variables.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2018-10-16 11:47:32 +02:00
parent b618a45b0f
commit c3ec4b8d6a

View File

@ -4717,6 +4717,7 @@ processBlockJobEvent(virQEMUDriverPtr driver,
int status)
{
virDomainDiskDefPtr disk;
qemuDomainDiskPrivatePtr diskPriv;
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
return;
@ -4726,8 +4727,17 @@ processBlockJobEvent(virQEMUDriverPtr driver,
goto endjob;
}
if ((disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NULL)))
qemuBlockJobEventProcess(driver, vm, disk, QEMU_ASYNC_JOB_NONE, type, status);
if (!(disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NULL))) {
VIR_DEBUG("disk %s not found", diskAlias);
goto endjob;
}
diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
diskPriv->blockJobType = type;
diskPriv->blockJobStatus = status;
qemuBlockJobUpdate(vm, QEMU_ASYNC_JOB_NONE, disk, NULL);
endjob:
qemuDomainObjEndJob(driver, vm);