On Mon, Jul 22, 2019 at 06:24:43PM +0200, Peter Krempa wrote:
On Thu, Jul 18, 2019 at 18:31:39 +0200, Peter Krempa wrote:
> Set the correct job states after the operation is requested in qemu.
>
> Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
> ---
> src/qemu/qemu_blockjob.c | 4 +++-
> src/qemu/qemu_driver.c | 8 +++++---
> 2 files changed, 8 insertions(+), 4 deletions(-)
later in my blockdev branch I found the following hunk which is needed
to correctly transition into the cancelled state when aborting the job
which I forgot to merge into this patch:
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 0f08cf7967..575292ada2 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -673,6 +673,10 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataPtr job,
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
goto cleanup;
+ if (job->newstate == QEMU_BLOCKJOB_STATE_COMPLETED &&
+ job->state == QEMU_BLOCKJOB_STATE_ABORTING)
+ job->newstate = QEMU_BLOCKJOB_STATE_CANCELLED;
+
if (refreshed)
qemuDomainSaveStatus(vm);
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano