]> xenbits.xensource.com Git - libvirt.git/commitdiff
tools: use NULLSTR_MINUS
authorJán Tomko <jtomko@redhat.com>
Tue, 12 Feb 2019 16:09:49 +0000 (17:09 +0100)
committerJán Tomko <jtomko@redhat.com>
Thu, 14 Feb 2019 13:09:37 +0000 (14:09 +0100)
Use the newly introduced macro in the few places that open-code it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
tools/virsh-domain-monitor.c
tools/virsh-snapshot.c

index 1897a626d5601a1ac40db5f37f741e21681a9108..49de81af8c50b095062bcba0cefdc01c767a93f3 100644 (file)
@@ -643,11 +643,11 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd)
                                 "|./source/@volume)", ctxt);
         if (details) {
             if (vshTableRowAppend(table, type, device, target,
-                                  source ? source : "-", NULL) < 0)
+                                  NULLSTR_MINUS(source), NULL) < 0)
                 goto cleanup;
         } else {
             if (vshTableRowAppend(table, target,
-                                  source ? source : "-", NULL) < 0)
+                                  NULLSTR_MINUS(source), NULL) < 0)
                 goto cleanup;
         }
 
index 6d8e2b299bb89f17a4a53841317c91af147b3d6a..90000ef1aace0109d339564a0f4bbe376c4dd3fe 100644 (file)
@@ -945,7 +945,7 @@ cmdSnapshotInfo(vshControl *ctl, const vshCmd *cmd)
     /* Since we already have the XML, there's no need to call
      * virDomainSnapshotGetParent */
     parent = virXPathString("string(/domainsnapshot/parent/name)", ctxt);
-    vshPrint(ctl, "%-15s %s\n", _("Parent:"), parent ? parent : "-");
+    vshPrint(ctl, "%-15s %s\n", _("Parent:"), NULLSTR_MINUS(parent));
 
     /* Children, Descendants.  After this point, the fallback to
      * compute children is too expensive, so we gracefully quit if the