virsh: net-port-create: log errors for non-existent xml file

Signed-off-by: Lin Ma <lma@suse.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Lin Ma 2020-09-16 15:17:34 +08:00 committed by Michal Privoznik
parent 80fcfab9ce
commit 29f6ba3f18
1 changed files with 3 additions and 1 deletions

View 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);