[libvirt PATCH 3/6] qemu: Make vm parameter of qemuProcessEventSubmit mandatory

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

 



All callers (QMP event handlers) always pass non-NULL vm pointer. Let's
make the parameter mandatory.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_process.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 44a4bcfd74..e492f6961d 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -284,16 +284,14 @@ qemuProcessEventSubmit(virQEMUDriver *driver,
 {
     struct qemuProcessEvent *event = g_new0(struct qemuProcessEvent, 1);
 
-    if (vm)
-        event->vm = virObjectRef(vm);
+    event->vm = virObjectRef(vm);
     event->eventType = eventType;
     event->action = action;
     event->status = status;
     event->data = data;
 
     if (virThreadPoolSendJob(driver->workerPool, 0, event) < 0) {
-        if (vm)
-            virObjectUnref(vm);
+        virObjectUnref(vm);
         qemuProcessEventFree(event);
     }
 }
-- 
2.35.1




[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