From 04b1c2d1e2e12abcca22380827edaa058399f4fa Mon Sep 17 00:00:00 2001
From: Jonathon Jongsma <jjongsma@redhat.com>
Date: Fri, 23 Oct 2020 16:40:09 -0500
Subject: [PATCH] qemu: combine conditionals

Trivial fix to improve readability by combining these into a compound
conditional.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
---
 src/qemu/qemu_monitor_json.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 604fcda1e3..445d794905 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -4020,9 +4020,10 @@ int qemuMonitorJSONAddFileHandleToSet(qemuMonitorPtr mon,
     if (virJSONValueObjectCreate(&args, "S:opaque", opaque, NULL) < 0)
         return -1;
 
-    if (fdset >= 0)
-        if (virJSONValueObjectAdd(args, "j:fdset-id", fdset, NULL) < 0)
-            return -1;
+    if (fdset >= 0 &&
+        virJSONValueObjectAdd(args, "j:fdset-id", fdset, NULL) < 0) {
+        return -1;
+    }
 
     if (!(cmd = qemuMonitorJSONMakeCommandInternal("add-fd", g_steal_pointer(&args))))
         return -1;