]> git.ipfire.org Git - thirdparty/libvirt.git/commit
snapshot: Give virDomainSnapshotDefFormat its own flags
authorEric Blake <eblake@redhat.com>
Fri, 15 Feb 2019 20:43:43 +0000 (14:43 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 7 Mar 2019 23:31:40 +0000 (17:31 -0600)
commitc50295590946a32efaf60bd4c6d16f5c2d8a430a
tree557c7c99d669a77e94669cc07eb983ac452db733
parent1ceb0e933781fb079fc54a5ecad3df8e699c6d3b
snapshot: Give virDomainSnapshotDefFormat its own flags

virDomainSnapshotDefFormat currently takes two sets of knobs:
an 'unsigned int flags' argument that can currently just be
VIR_DOMAIN_DEF_FORMAT_SECURE, and an 'int internal' argument used as
a bool to determine whether to output an additional element.  It
then reuses the 'flags' knob to call into virDomainDefFormatInternal(),
which takes a different set of flags. In fact, prior to commit 0ecd6851
(1.2.12), the 'flags' argument actually took the public
VIR_DOMAIN_XML_SECURE, which was even more confusing.  Let's borrow
from the style of that earlier commit, by introducing a function
for translating from the public flags (VIR_DOMAIN_SNAPSHOT_XML_SECURE
was just recently introduced) into a new enum specific to snapshot
formatting, and adjust all callers to use snapshot-specific enum
values when formatting, and where the formatter now uses a new
variable 'domainflags' to make it obvious when we are translating
from snapshot flags back to domain flags.  We don't even have to
use the conversion function for drivers that don't accept the
public VIR_DOMAIN_SNAPSHOT_XML_SECURE flag.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/conf/snapshot_conf.c
src/conf/snapshot_conf.h
src/esx/esx_driver.c
src/libvirt_private.syms
src/qemu/qemu_domain.c
src/qemu/qemu_driver.c
src/test/test_driver.c
src/vbox/vbox_common.c
src/vz/vz_driver.c
tests/domainsnapshotxml2xmltest.c