mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
snapshot: fine-tune ability to start paused
While it is nice that snapshots and saved images remember whether the domain was running or paused, sometimes the restoration phase wants to guarantee a particular state (paused to allow hot-plugging, or running without needing to call resume). This introduces new flags to allow the control, and a later patch will implement the flags for qemu. * include/libvirt/libvirt.h.in (VIR_DOMAIN_SAVE_RUNNING) (VIR_DOMAIN_SAVE_PAUSED, VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING) (VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED): New flags. * src/libvirt.c (virDomainSaveFlags, virDomainRestoreFlags) (virDomainManagedSave, virDomainSaveImageDefineXML) (virDomainRevertToSnapshot): Document their use, and enforce mutual exclusion.
This commit is contained in:
@@ -960,11 +960,14 @@ int virDomainResume (virDomainPtr domain);
|
||||
|
||||
/**
|
||||
* virDomainSaveRestoreFlags:
|
||||
* Flags for use in virDomainSaveFlags(), virDomainManagedSave(), and
|
||||
* virDomainRestoreFlags().
|
||||
* Flags for use in virDomainSaveFlags(), virDomainManagedSave(),
|
||||
* virDomainRestoreFlags(), and virDomainSaveImageDefineXML(). Not all
|
||||
* flags apply to all these functions.
|
||||
*/
|
||||
typedef enum {
|
||||
VIR_DOMAIN_SAVE_BYPASS_CACHE = 1 << 0, /* Avoid file system cache pollution */
|
||||
VIR_DOMAIN_SAVE_RUNNING = 1 << 1, /* Favor running over paused */
|
||||
VIR_DOMAIN_SAVE_PAUSED = 1 << 2, /* Favor paused over running */
|
||||
} virDomainSaveRestoreFlags;
|
||||
|
||||
int virDomainSave (virDomainPtr domain,
|
||||
@@ -2579,6 +2582,11 @@ int virDomainHasCurrentSnapshot(virDomainPtr domain, unsigned int flags);
|
||||
virDomainSnapshotPtr virDomainSnapshotCurrent(virDomainPtr domain,
|
||||
unsigned int flags);
|
||||
|
||||
typedef enum {
|
||||
VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING = 1 << 0, /* Run after revert */
|
||||
VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED = 1 << 1, /* Pause after revert */
|
||||
} virDomainSnapshotRevertFlags;
|
||||
|
||||
/* Revert the domain to a point-in-time snapshot. The
|
||||
* state of the guest after this call will be the state
|
||||
* of the guest when the snapshot in question was taken
|
||||
|
||||
Reference in New Issue
Block a user