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 <pkrempa(a)redhat.com>
---
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 ba98ef2259..1b7a372434 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;
}
--
2.20.1