]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix virsh snapshot-list error reporting
authorJim Fehlig <jfehlig@suse.com>
Thu, 25 Jul 2013 20:18:14 +0000 (14:18 -0600)
committerJim Fehlig <jfehlig@suse.com>
Thu, 25 Jul 2013 20:22:47 +0000 (14:22 -0600)
Noticed that the expected "not supported" error is dropped when
invoking 'virsh snapshot-list dom' on a Xen installation running
the libxl driver

 virsh snapshot-list test
 error: Invalid snapshot: virDomainSnapshotFree

The error is overwritten by a call to virDomainSnapshotFree
in cleanup code within cmdSnapshotList.  Prevent overwritting
the real error by not calling virDomainSnapshotFree with a NULL
virDomainSnapshotPtr.

tools/virsh-snapshot.c

index cfe8ee90820ccb3443cbb10042633581a274584d..db9715bcb23332e3c47470738be394405e2ae9ad 100644 (file)
@@ -1678,7 +1678,8 @@ cleanup:
     vshSnapshotListFree(snaplist);
     VIR_FREE(parent_snap);
     VIR_FREE(state);
-    virDomainSnapshotFree(start);
+    if (start)
+        virDomainSnapshotFree(start);
     xmlXPathFreeContext(ctxt);
     xmlFreeDoc(xml);
     VIR_FREE(doc);