From: Jim Fehlig Date: Thu, 25 Jul 2013 20:18:14 +0000 (-0600) Subject: Fix virsh snapshot-list error reporting X-Git-Tag: v1.1.1-rc2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3b21cdc315439dda2dcdc0781d5ae1d2f082c21;p=thirdparty%2Flibvirt.git Fix virsh snapshot-list error reporting 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. --- diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index cfe8ee9082..db9715bcb2 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -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);