[PATCH libvirt 2/3] events: move NULL check to EventStateQueueRemote

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

 



Remove NULL check from virObjectEventStateQueue and add NULL check to virObjectEventStateQueueRemote

Remove NULL check around call to virObjectEventStateQueueRemote in
remote_driver.c

Signed-off-by: Anya Harter <aharter@xxxxxxxxxx>
---
 src/conf/object_event.c    | 6 +++---
 src/remote/remote_driver.c | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/conf/object_event.c b/src/conf/object_event.c
index 826197000b..dd5c6ff32d 100644
--- a/src/conf/object_event.c
+++ b/src/conf/object_event.c
@@ -744,6 +744,9 @@ virObjectEventStateQueueRemote(virObjectEventStatePtr state,
                                virObjectEventPtr event,
                                int remoteID)
 {
+    if (!event)
+        return;
+
     if (state->timer < 0) {
         virObjectUnref(event);
         return;
@@ -776,9 +779,6 @@ void
 virObjectEventStateQueue(virObjectEventStatePtr state,
                          virObjectEventPtr event)
 {
-   if (!event)
-       return;
-
     virObjectEventStateQueueRemote(state, event, -1);
 }
 
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index c22993ce9e..fbec5c727b 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -4435,8 +4435,7 @@ static void
 remoteEventQueue(struct private_data *priv, virObjectEventPtr event,
                  int remoteID)
 {
-    if (event)
-        virObjectEventStateQueueRemote(priv->eventState, event, remoteID);
+    virObjectEventStateQueueRemote(priv->eventState, event, remoteID);
 }
 
 
-- 
2.17.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