[PATCH 2/4] qemu: blockjob: Don't emit traditional disk events for jobs without disk

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

 



With -blockdev it will be possible that a block job loses the disk that
was used to start it to a guest-initiated hot-unplug. Don't emit the
block job events in that case as we can't report the top level source or
disk target for an unplugged (and potentially replugged with different
source) disk.

Eventually when we add machinery for tracking jobs globally for a VM the
event will be reinstated via the domain job event.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_blockjob.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index a4662342a7..b3bdbeb990 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -216,6 +216,10 @@ qemuBlockJobEmitEvents(virQEMUDriverPtr driver,
     virObjectEventPtr event = NULL;
     virObjectEventPtr event2 = NULL;

+    /* don't emit events for jobs without disk */
+    if (!disk)
+        return;
+
     /* don't emit events for internal jobs and states */
     if (type >= VIR_DOMAIN_BLOCK_JOB_TYPE_LAST ||
         status >= VIR_DOMAIN_BLOCK_JOB_LAST)
-- 
2.21.0

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