From 29f6ba3f188dcdccde3cdee564f9de6765f960a5 Mon Sep 17 00:00:00 2001 From: Lin Ma Date: Wed, 16 Sep 2020 15:17:34 +0800 Subject: [PATCH] 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 --- tools/virsh-network.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.47.2