]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: use vshError consistently after virBufferError checks
authorPino Toscano <ptoscano@redhat.com>
Wed, 24 Aug 2016 14:14:25 +0000 (16:14 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 24 Aug 2016 15:43:29 +0000 (17:43 +0200)
If virBufferError() reports an error, then vshError() is needed to
report the error situation instead of a simple vshError().

tools/virsh-domain.c
tools/virsh-pool.c
tools/virsh-volume.c

index 26b1457b5a17c346a038f0361edcfcd9a358ad0a..de2a22c0597cff9e83f3fa1baa0d26939fac8695 100644 (file)
@@ -737,7 +737,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
     virBufferAddLit(&buf, "</disk>\n");
 
     if (virBufferError(&buf)) {
-        vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
+        vshError(ctl, "%s", _("Failed to allocate XML buffer"));
         goto cleanup;
     }
 
@@ -1048,7 +1048,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
     virBufferAddLit(&buf, "</interface>\n");
 
     if (virBufferError(&buf)) {
-        vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
+        vshError(ctl, "%s", _("Failed to allocate XML buffer"));
         goto cleanup;
     }
 
@@ -7831,7 +7831,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd)
         type = VIR_DOMAIN_METADATA_DESCRIPTION;
 
     if (virBufferError(&buf)) {
-        vshPrint(ctl, "%s", _("Failed to collect new description/title"));
+        vshError(ctl, "%s", _("Failed to collect new description/title"));
         goto cleanup;
     }
     desc = virBufferContentAndReset(&buf);
@@ -8955,7 +8955,7 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd)
     virBufferTrim(&buf, " ", -1);
 
     if (virBufferError(&buf)) {
-        vshPrint(ctl, "%s", _("Failed to collect command"));
+        vshError(ctl, "%s", _("Failed to collect command"));
         goto cleanup;
     }
     monitor_cmd = virBufferContentAndReset(&buf);
@@ -9269,7 +9269,7 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
         virBufferAdd(&buf, opt->data, -1);
     }
     if (virBufferError(&buf)) {
-        vshPrint(ctl, "%s", _("Failed to collect command"));
+        vshError(ctl, "%s", _("Failed to collect command"));
         goto cleanup;
     }
     guest_agent_cmd = virBufferContentAndReset(&buf);
@@ -10820,7 +10820,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
 
         /* Ensure we can print our URI */
         if (virBufferError(&buf)) {
-            vshPrint(ctl, "%s", _("Failed to create display URI"));
+            vshError(ctl, "%s", _("Failed to create display URI"));
             goto cleanup;
         }
 
index f952887b818cbebcb4b1d0328d43ae64c922413b..d25851e943a866d143f2acc28977af0b425c9b14 100644 (file)
@@ -376,7 +376,7 @@ virshBuildPoolXML(vshControl *ctl,
     virBufferAddLit(&buf, "</pool>\n");
 
     if (virBufferError(&buf)) {
-        vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
+        vshError(ctl, "%s", _("Failed to allocate XML buffer"));
         return false;
     }
 
index a2f0432462bd79ef670bc2522ef9ea3fc21e8fd9..b7debc2dd51d62b2f6d93933fe384529c7104682 100644 (file)
@@ -337,7 +337,7 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
     virBufferAddLit(&buf, "</volume>\n");
 
     if (virBufferError(&buf)) {
-        vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
+        vshError(ctl, "%s", _("Failed to allocate XML buffer"));
         goto cleanup;
     }
     xml = virBufferContentAndReset(&buf);