mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-05 04:41:20 +00:00
a007fcab3b
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> |
||
---|---|---|
.. | ||
basictypes.rng | ||
capability.rng | ||
cputypes.rng | ||
domain.rng | ||
domaincaps.rng | ||
domaincommon.rng | ||
domainsnapshot.rng | ||
interface.rng | ||
network.rng | ||
networkcommon.rng | ||
nodedev.rng | ||
nwfilter_params.rng | ||
nwfilter.rng | ||
nwfilterbinding.rng | ||
secret.rng | ||
storagecommon.rng | ||
storagepool.rng | ||
storagepoolcaps.rng | ||
storagevol.rng |