libvirt/tests/domainsnapshotxml2xmlout
Eric Blake a007fcab3b snapshot: Don't expose testsuite-only state in snapshot XML
None of the existing drivers actually use the 0-valued 'nostate'
snapshot state; rather, it was a fluke of implementation. In fact,
some drivers, like qemu, actively reject 'nostate' as invalid during a
snapshot redefine. Normally, a driver computes the state post-parse
from the current domain, and thus virDomainSnapshotGetXMLDesc() will
never expose the state. However, since the testsuite lacks any
associated domain to copy state from, and lacks post-parse processing
that normal drivers have, the testsuite output had several spots with
the state, coupled with a regex filter to ignore the oddity.

It is better to follow the lead of other XML defaults, by not
outputting anything during format if post-parse defaults have not been
applied, and rejecting the default value during parsing. The testsuite
needs a bit of an update, by adding another flag for when to simulate
a post-parse action of setting a snapshot state, but none of the
drivers are impacted other than rejecting XML that was previously
already suspicious in nature.

Similarly, don't expose creation time 0 (for now, only possible if a
user redefined a snapshot to claim creation at the Epoch, but also
happens once setting the creation time is deferred to a post-parse
handler).

This is also a step towards cleaning up snapshot_conf.c to separate
its existing post-parse work (namely, setting the creationTime and
default snapshot name) from the pure parsing work, so that we can get
rid of the testsuite hack of regex filtering of the XML and instead
have more accurate testing of our parser/formatter code.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-04-16 21:55:52 -05:00
..
all_parameters.xml snapshot: new XML for external system checkpoint 2012-11-02 09:56:23 -06:00
disk_driver_name_null.xml snapshot: Add support for specifying snapshot disk backing type 2014-01-29 12:56:35 +01:00
disk_snapshot_redefine.xml tests: domainsnapshotxml2xml: Remove testing with allowed format detection 2018-03-13 13:54:06 +01:00
disk_snapshot.xml storage: Store RBD image name as pool and image name 2017-11-07 14:58:04 +01:00
empty.xml snapshot: Don't expose testsuite-only state in snapshot XML 2019-04-16 21:55:52 -05:00
external_vm_redefine.xml tests: domainsnapshotxml2xml: Remove testing with allowed format detection 2018-03-13 13:54:06 +01:00
external_vm.xml domainsnapshotxml2xmltest: Add existing files as new tests 2013-12-05 09:41:29 +01:00
full_domain.xml tests: domainsnapshotxml2xml: Remove testing with allowed format detection 2018-03-13 13:54:06 +01:00
metadata.xml tests: domainsnapshotxml2xml: Remove testing with allowed format detection 2018-03-13 13:54:06 +01:00
name_and_description.xml snapshot: Don't expose testsuite-only state in snapshot XML 2019-04-16 21:55:52 -05:00
noparent_nodescription_noactive.xml snapshot: new XML for external system checkpoint 2012-11-02 09:56:23 -06:00
noparent_nodescription.xml snapshot: new XML for external system checkpoint 2012-11-02 09:56:23 -06:00
noparent.xml snapshot: Don't expose testsuite-only state in snapshot XML 2019-04-16 21:55:52 -05:00