From c6db2730825184f6fadbebe722e3391951c9dd1e Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 24 Jan 2019 10:31:38 +0100 Subject: [PATCH] qemu: blockjob: Mark job as started only when it's new Switching a block job to some states (e.g. QEMU_BLOCKJOB_STATE_READY) might not require a job, thus if it will become ready asynchronously we should not overwrite the state any more. Signed-off-by: Peter Krempa Reviewed-by: John Ferlan --- src/qemu/qemu_blockjob.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 2f9f2b5b04..09a2975231 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -149,7 +149,8 @@ qemuBlockJobDiskGetJob(virDomainDiskDefPtr disk) void qemuBlockJobStarted(qemuBlockJobDataPtr job) { - job->state = QEMU_BLOCKJOB_STATE_RUNNING; + if (job->state == QEMU_BLOCKJOB_STATE_NEW) + job->state = QEMU_BLOCKJOB_STATE_RUNNING; } -- GitLab