From c3ec4b8d6a776890373778c5c41cedf32de650da Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 16 Oct 2018 11:47:32 +0200 Subject: [PATCH] qemu: processBlockJobEvent: Use qemuBlockJobUpdate to process block job events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- src/qemu/qemu_driver.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5032edec50..3010d87537 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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);