[libvirt] [PATCH 2/7] virsh: Error out while domain not found for 'event' command

Lin Ma lma at suse.com
Fri May 4 09:28:49 UTC 2018


Signed-off-by: Lin Ma <lma at suse.com>
---
 tools/virsh-domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 3b2a34f936..1f3ea0c939 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -13445,7 +13445,9 @@ cmdEvent(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
 
     if (vshCommandOptBool(cmd, "domain"))
-        dom = virshCommandOptDomain(ctl, cmd, NULL);
+        if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
+            goto cleanup;
+
     if (vshEventStart(ctl, timeout) < 0)
         goto cleanup;
 
-- 
2.15.1




More information about the libvir-list mailing list