]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: combine conditionals
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 23 Oct 2020 21:40:09 +0000 (16:40 -0500)
committerLaine Stump <laine@redhat.com>
Fri, 23 Oct 2020 22:39:30 +0000 (18:39 -0400)
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

index 604fcda1e3b3f3a3330511b2089f8d12bb908dcd..445d7949053b964f5a199877f34bf7b869631eff 100644 (file)
@@ -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;