mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
virsh: use vshError consistently after virBufferError checks
If virBufferError() reports an error, then vshError() is needed to report the error situation instead of a simple vshError().
This commit is contained in:
parent
a144f28467
commit
4362ff4337
@ -737,7 +737,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
|
|||||||
virBufferAddLit(&buf, "</disk>\n");
|
virBufferAddLit(&buf, "</disk>\n");
|
||||||
|
|
||||||
if (virBufferError(&buf)) {
|
if (virBufferError(&buf)) {
|
||||||
vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
|
vshError(ctl, "%s", _("Failed to allocate XML buffer"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1048,7 +1048,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
|
|||||||
virBufferAddLit(&buf, "</interface>\n");
|
virBufferAddLit(&buf, "</interface>\n");
|
||||||
|
|
||||||
if (virBufferError(&buf)) {
|
if (virBufferError(&buf)) {
|
||||||
vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
|
vshError(ctl, "%s", _("Failed to allocate XML buffer"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7831,7 +7831,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd)
|
|||||||
type = VIR_DOMAIN_METADATA_DESCRIPTION;
|
type = VIR_DOMAIN_METADATA_DESCRIPTION;
|
||||||
|
|
||||||
if (virBufferError(&buf)) {
|
if (virBufferError(&buf)) {
|
||||||
vshPrint(ctl, "%s", _("Failed to collect new description/title"));
|
vshError(ctl, "%s", _("Failed to collect new description/title"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
desc = virBufferContentAndReset(&buf);
|
desc = virBufferContentAndReset(&buf);
|
||||||
@ -8955,7 +8955,7 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd)
|
|||||||
virBufferTrim(&buf, " ", -1);
|
virBufferTrim(&buf, " ", -1);
|
||||||
|
|
||||||
if (virBufferError(&buf)) {
|
if (virBufferError(&buf)) {
|
||||||
vshPrint(ctl, "%s", _("Failed to collect command"));
|
vshError(ctl, "%s", _("Failed to collect command"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
monitor_cmd = virBufferContentAndReset(&buf);
|
monitor_cmd = virBufferContentAndReset(&buf);
|
||||||
@ -9269,7 +9269,7 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
|
|||||||
virBufferAdd(&buf, opt->data, -1);
|
virBufferAdd(&buf, opt->data, -1);
|
||||||
}
|
}
|
||||||
if (virBufferError(&buf)) {
|
if (virBufferError(&buf)) {
|
||||||
vshPrint(ctl, "%s", _("Failed to collect command"));
|
vshError(ctl, "%s", _("Failed to collect command"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
guest_agent_cmd = virBufferContentAndReset(&buf);
|
guest_agent_cmd = virBufferContentAndReset(&buf);
|
||||||
@ -10820,7 +10820,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
|
|||||||
|
|
||||||
/* Ensure we can print our URI */
|
/* Ensure we can print our URI */
|
||||||
if (virBufferError(&buf)) {
|
if (virBufferError(&buf)) {
|
||||||
vshPrint(ctl, "%s", _("Failed to create display URI"));
|
vshError(ctl, "%s", _("Failed to create display URI"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,7 +376,7 @@ virshBuildPoolXML(vshControl *ctl,
|
|||||||
virBufferAddLit(&buf, "</pool>\n");
|
virBufferAddLit(&buf, "</pool>\n");
|
||||||
|
|
||||||
if (virBufferError(&buf)) {
|
if (virBufferError(&buf)) {
|
||||||
vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
|
vshError(ctl, "%s", _("Failed to allocate XML buffer"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
|
|||||||
virBufferAddLit(&buf, "</volume>\n");
|
virBufferAddLit(&buf, "</volume>\n");
|
||||||
|
|
||||||
if (virBufferError(&buf)) {
|
if (virBufferError(&buf)) {
|
||||||
vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
|
vshError(ctl, "%s", _("Failed to allocate XML buffer"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
xml = virBufferContentAndReset(&buf);
|
xml = virBufferContentAndReset(&buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user