<div dir="ltr"><div><div>I guess you meant "If virBufferError() reports an error, then vshError() is needed to
report the error situation instead of a simple vshPrint()." :-)<br><br></div>Had me confused for a bit there.<br><br></div>Nishith<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 24, 2016 at 7:44 PM, Pino Toscano <span dir="ltr"><<a href="mailto:ptoscano@redhat.com" target="_blank">ptoscano@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If virBufferError() reports an error, then vshError() is needed to<br>
report the error situation instead of a simple vshError().<br>
---<br>
 tools/virsh-domain.c | 12 ++++++------<br>
 tools/virsh-pool.c   |  2 +-<br>
 tools/virsh-volume.c |  2 +-<br>
 3 files changed, 8 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c<br>
index 26b1457..de2a22c 100644<br>
--- a/tools/virsh-domain.c<br>
+++ b/tools/virsh-domain.c<br>
@@ -737,7 +737,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)<br>
     virBufferAddLit(&buf, "</disk>\n");<br>
<br>
     if (virBufferError(&buf)) {<br>
-        vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));<br>
+        vshError(ctl, "%s", _("Failed to allocate XML buffer"));<br>
         goto cleanup;<br>
     }<br>
<br>
@@ -1048,7 +1048,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)<br>
     virBufferAddLit(&buf, "</interface>\n");<br>
<br>
     if (virBufferError(&buf)) {<br>
-        vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));<br>
+        vshError(ctl, "%s", _("Failed to allocate XML buffer"));<br>
         goto cleanup;<br>
     }<br>
<br>
@@ -7831,7 +7831,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd)<br>
         type = VIR_DOMAIN_METADATA_<wbr>DESCRIPTION;<br>
<br>
     if (virBufferError(&buf)) {<br>
-        vshPrint(ctl, "%s", _("Failed to collect new description/title"));<br>
+        vshError(ctl, "%s", _("Failed to collect new description/title"));<br>
         goto cleanup;<br>
     }<br>
     desc = virBufferContentAndReset(&buf)<wbr>;<br>
@@ -8955,7 +8955,7 @@ cmdQemuMonitorCommand(<wbr>vshControl *ctl, const vshCmd *cmd)<br>
     virBufferTrim(&buf, " ", -1);<br>
<br>
     if (virBufferError(&buf)) {<br>
-        vshPrint(ctl, "%s", _("Failed to collect command"));<br>
+        vshError(ctl, "%s", _("Failed to collect command"));<br>
         goto cleanup;<br>
     }<br>
     monitor_cmd = virBufferContentAndReset(&buf)<wbr>;<br>
@@ -9269,7 +9269,7 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)<br>
         virBufferAdd(&buf, opt->data, -1);<br>
     }<br>
     if (virBufferError(&buf)) {<br>
-        vshPrint(ctl, "%s", _("Failed to collect command"));<br>
+        vshError(ctl, "%s", _("Failed to collect command"));<br>
         goto cleanup;<br>
     }<br>
     guest_agent_cmd = virBufferContentAndReset(&buf)<wbr>;<br>
@@ -10820,7 +10820,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)<br>
<br>
         /* Ensure we can print our URI */<br>
         if (virBufferError(&buf)) {<br>
-            vshPrint(ctl, "%s", _("Failed to create display URI"));<br>
+            vshError(ctl, "%s", _("Failed to create display URI"));<br>
             goto cleanup;<br>
         }<br>
<br>
diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c<br>
index f952887..d25851e 100644<br>
--- a/tools/virsh-pool.c<br>
+++ b/tools/virsh-pool.c<br>
@@ -376,7 +376,7 @@ virshBuildPoolXML(vshControl *ctl,<br>
     virBufferAddLit(&buf, "</pool>\n");<br>
<br>
     if (virBufferError(&buf)) {<br>
-        vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));<br>
+        vshError(ctl, "%s", _("Failed to allocate XML buffer"));<br>
         return false;<br>
     }<br>
<br>
diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c<br>
index a2f0432..b7debc2 100644<br>
--- a/tools/virsh-volume.c<br>
+++ b/tools/virsh-volume.c<br>
@@ -337,7 +337,7 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)<br>
     virBufferAddLit(&buf, "</volume>\n");<br>
<br>
     if (virBufferError(&buf)) {<br>
-        vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));<br>
+        vshError(ctl, "%s", _("Failed to allocate XML buffer"));<br>
         goto cleanup;<br>
     }<br>
     xml = virBufferContentAndReset(&buf)<wbr>;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
--<br>
libvir-list mailing list<br>
<a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvir-list" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/libvir-list</a><br>
</font></span></blockquote></div><br></div>