Re: [libvirt PATCH 2/2] qemu: combine conditionals

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

 



On 10/23/20 5:40 PM, Jonathon Jongsma wrote:
Trivial fix to improve readability by combining these into a compound
conditional.

Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
---
  src/qemu/qemu_monitor_json.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 2491cbf9b8..8d3b6c98e3 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -4020,9 +4020,9 @@ 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;


In this case, I've added braces rather than combining the lines, since each is a separate subexpression, rather than just pieces of a single simple expression, as was the case in the previous patch.


Reviewed-by: Laine Stump <laine@xxxxxxxxxx>


and pushed.


if (!(cmd = qemuMonitorJSONMakeCommandInternal("add-fd",
                                                     g_steal_pointer(&args))))





[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