]> xenbits.xensource.com Git - people/dariof/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)
committerEric Blake <eblake@redhat.com>
Fri, 16 Nov 2012 05:21:35 +0000 (22:21 -0700)
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=876868

tools/virsh-domain.c

index d483f3ff387b89618497ccfe8d8c7a4ba011963f..8c557f6c1a3cc78ee918df3a885335d9e1aed410 100644 (file)
@@ -2966,8 +2966,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)