]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: save: report an error if XML file can't be read
authorJán Tomko <jtomko@redhat.com>
Thu, 15 Nov 2012 13:25:09 +0000 (14:25 +0100)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:29:38 +0000 (16:29 -0500)
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=876868
(cherry picked from commit 58110b48870b4e8efd1d833e3ecbef41b62d1877)

tools/virsh-domain.c

index 505169bddffcfbe1bcc5c89d2f062561f8694032..123afdead384355363e2ec15f96e72ba24c25ab7 100644 (file)
@@ -2933,8 +2933,10 @@ doSave(void *opaque)
         goto out;
 
     if (xmlfile &&
-        virFileReadAll(xmlfile, 8192, &xml) < 0)
+        virFileReadAll(xmlfile, 8192, &xml) < 0) {
+        vshReportError(ctl);
         goto out;
+    }
 
     if (((flags || xml)
          ? virDomainSaveFlags(dom, to, xml, flags)