]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: net-port-create: log errors for non-existent xml file
authorLin Ma <lma@suse.de>
Wed, 16 Sep 2020 07:17:34 +0000 (15:17 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 17 Sep 2020 10:25:45 +0000 (12:25 +0200)
Signed-off-by: Lin Ma <lma@suse.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-network.c

index 0351a93f1981051672106c4f6312da631a7ab1cc..8a683969f9ed3e3b4c7b4f14a4ac26725862d883 100644 (file)
@@ -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);