]> git.ipfire.org Git - thirdparty/libvirt.git/commit
maint: improve VIR_ERR_INVALID_DOMAIN_SNAPSHOT usage
authorEric Blake <eblake@redhat.com>
Sat, 28 Dec 2013 01:12:05 +0000 (18:12 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 9 Jan 2014 21:47:02 +0000 (14:47 -0700)
commitdd0e04d9d089c516a83f0f7702c1d1d2a1fab873
tree0f64e2dd7b3015517858efe8348c116167e6ce6a
parent7d0a0ab7dd64b03715966be7f1433769bcef1041
maint: improve VIR_ERR_INVALID_DOMAIN_SNAPSHOT usage

The existing check of domain snapshots validated that they
point to a domain, but did not validate that the domain
points to a connection, even though any errors blindly assume
the connection is valid.  On the other hand, as mentioned in
commit 6e130ddc, any valid domain is already tied to a valid
connection, and VIR_IS_SNAPSHOT vs. VIR_IS_DOMAIN_SNAPSHOT
makes no real difference; it's best to just validate the chain
of all three.  For consistency with previous patches, continue
the trend of using a common macro.  For now, we don't need
virCheckDomainSnapshotGoto().

* src/datatypes.h (virCheckDomainSnapshotReturn): New macro.
(VIR_IS_SNAPSHOT, VIR_IS_DOMAIN_SNAPSHOT):
Drop unused macros.
* src/libvirt.c: Use macro throughout.
(virLibDomainSnapshotError): Drop unused macro.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/datatypes.h
src/libvirt.c