]> git.ipfire.org Git - thirdparty/libvirt.git/commit
snapshot: Define explicit flags for snapshot xml
authorEric Blake <eblake@redhat.com>
Wed, 13 Feb 2019 21:09:05 +0000 (15:09 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 20 Feb 2019 03:34:42 +0000 (21:34 -0600)
commita27031c4085906612804776a489a39da4d9ba963
treed5034a3773b908e74cb33a15e2a57424dd38d6d5
parent12a51f372aead207ec1cdf47b07552630860900d
snapshot: Define explicit flags for snapshot xml

Commit f609cb85 (0.9.5) introduced virDomainSnapshotGetXMLDesc()'s use
of @flags as a subset of virDomainXMLFlags, documenting that 2 of the
3 flags defined at the time would never be valid.  Later, commit
28f8dfdc (1.0.0) introduced a new flag, VIR_DOMAIN_XML_MIGRATABLE, but
did not adjust the snapshot documentation to declare it as invalid.
However, since the flag is not accepted as valid by any of the
drivers (remote is just passthrough; esx and vbox don't support flags;
qemu, test, and vz only support VIR_DOMAIN_XML_SECURE), and it is
unlikely that the domain state saved off during a snapshot creation
needs to be migration-friendly (as the snapshot is not the source of
a migration), it is easier to just define an explicit set of supported
flags directly related to the snapshot API rather than trying to
borrow from domain API, and risking confusion if even more domain
flags are added later (in fact, I have an upcoming patch that plans to
add a new flag to virDomainGetXMLDesc that makes no sense for
snapshots).

There is no API or ABI impact (since we purposefully used unsigned int
rather than an enum type in public API, and since the new flag name
carries the same value as the reused name).

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
include/libvirt/libvirt-domain-snapshot.h
src/libvirt-domain-snapshot.c
src/qemu/qemu_driver.c
src/remote/remote_protocol.x
src/test/test_driver.c
src/vz/vz_driver.c