mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
a6a25d5cb6
Based on recent list questions about the proposed addition of virDomainCheckpointCreateXML(REDEFINE), it is worth adding some clarification to the existing snapshot redefine documentation that is serving as the basis for checkpoints. Normal snapshot creation requires very few elements from the user XML (libvirt can pick sane defaults for items that are omitted, and many fields, including <domain>, are documented as readonly output fields ignored on input, produced by drivers that track it). But during REDEFINE, the API wants the complete XML produced by an earlier virDomainSnapshotGetXMLDesc; as the domain definition has likely changed since the snapshot was first created, libvirt is unable to recreate a <domain> sub-element that matches the original output representing the domain state at the time the snapshot was first created. In fact, reverting without a <domain> sub-element is risky enough that we had to add a FORCE flag for virDomainSnapshotRevert(). In short, we only support omitting domain for qemu because of backwards-compatibility to snapshots created before 0.9.5 started capturing <domain>; even though there are other drivers like vbox that do not output <domain> because they have other reliable ways to revert. And based on the confusion caused when omitting <domain> from snapshot XML, the initial design for checkpoints in later patches will make <domain> a mandatory element during its REDEFINE. [Side note: the fact that <domain> can appear in <domainsnapshot> is a reason we cannot add a new API for a bulk listing or redefine of all snapshots of a single domain in one XML call (for example, a 1M <domain> XML * 16 snapshots explodes into 16M in a bulk form, which gets difficult to send over RPC). Perhaps we could add a flag to request that the <domain> sub-element be omitted on output, but such output is no longer suitable for sane REDEFINE input.] Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>