]> git.ipfire.org Git - thirdparty/libvirt.git/commit
backup: Parse and output checkpoint XML
authorEric Blake <eblake@redhat.com>
Sun, 8 Jul 2018 02:01:14 +0000 (21:01 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 26 Jul 2019 21:48:58 +0000 (16:48 -0500)
commit1a4df34a0fadfd58c8b57d64152acd4f661d8243
tree375bb63a47a462fc1afa95b7d60db3537124de8e
parent9943c42a22c264588a24ce29c3eb9a4bacc14dbe
backup: Parse and output checkpoint XML

Add a new file checkpoint_conf.c that performs the translation to and
from new XML describing a checkpoint. The code shares a common base
class with snapshots, since a checkpoint similarly represents the
domain state at a moment in time. Add some basic testing of round trip
XML handling through the new code.

Of note - this code intentionally differs from snapshots in that XML
schema validation is unconditional, rather than based on a public API
flag.  We have many existing interfaces that still need to add a flag
for opt-in schema validation, but those interfaces have existing
clients that may not have been producing strictly-compliant XML, or we
may still uncover bugs where our RNG grammar is inconsistent with our
code (where omitting the opt-in flag allows existing apps to keep
working while waiting for an RNG patch).  But since checkpoints are
brand-new, it's easier to ensure the code matches the schema by always
using the schema.  If needed, a later patch could extend the API and
add a flag to turn on to request schema validation, rather than having
it forced (possibly just the validation of the <domain> sub-element
during REDEFINE) - but if a user encounters XML that looks like it
should be good but fails to validate with our RNG schema, they would
either have to upgrade to a new libvirt that adds the new flag, or
upgrade to a new libvirt that fixes the RNG schema, which implies
adding such a flag won't help much.

Also, the redefine flag requires the <domain> sub-element to be
present, rather than catering to historical back-compat to older
versions.

Signed-off-by: Eric Blake <eblake@redhat.com>
po/POTFILES
src/conf/Makefile.inc.am
src/conf/checkpoint_conf.c [new file with mode: 0644]
src/conf/checkpoint_conf.h [new file with mode: 0644]
src/conf/virconftypes.h
src/libvirt_private.syms
tests/Makefile.am
tests/qemudomaincheckpointxml2xmlout/internal-active-invalid.xml [new file with mode: 0644]
tests/qemudomaincheckpointxml2xmlout/internal-inactive-invalid.xml [new file with mode: 0644]
tests/qemudomaincheckpointxml2xmltest.c [new file with mode: 0644]