From: Lin Ma Date: Wed, 16 Sep 2020 07:17:34 +0000 (+0800) Subject: virsh: net-port-create: log errors for non-existent xml file X-Git-Tag: v6.8.0-rc1~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29f6ba3f188dcdccde3cdee564f9de6765f960a5;p=thirdparty%2Flibvirt.git virsh: net-port-create: log errors for non-existent xml file Signed-off-by: Lin Ma Signed-off-by: Michal Privoznik Reviewed-by: Michal Privoznik --- diff --git a/tools/virsh-network.c b/tools/virsh-network.c index 0351a93f19..8a683969f9 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -1506,8 +1506,10 @@ cmdNetworkPortCreate(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) goto cleanup; - if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0) + if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0) { + vshSaveLibvirtError(); goto cleanup; + } port = virNetworkPortCreateXML(network, buffer, 0);