[PATCH 3/5] qemu: blockjob: Mark job as started only when it's new

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux