[libvirt] [PATCH 3/7] snapshot: Add flag to enable creating checkpoints in paused state

Eric Blake eblake at redhat.com
Thu Oct 11 03:30:22 UTC 2012


On 10/09/2012 07:39 AM, Peter Krempa wrote:
> The default behavior while creating external checkpoints is to let the
> guest run while the memory state is caputred. This leads to a larger

s/caputred/captured/

> save file but minimizes the time needed to take the checkpoint.

I'd rather swap the defaults.  After all, virDomainMigrate and
virDomainCoreDump default to offline, and require a _LIVE flag to force
live saves, as live is trickier to implement and might not converge, so
it is not a good default.

> 
> This patch adds a flag that causes the guest to be paused before taking
> the snapshot.
>  *include/libvirt/libvirt.h.in:
>     - add new paused reason: VIR_DOMAIN_PAUSED_SNAPSHOT
>     - add new flag for takin snapshot: VIR_DOMAIN_SNAPSHOT_CREATE_PAUSE
>  *tools/virsh-domain-monitor.c:
>     - add string representation for VIR_DOMAIN_PAUSED_SNAPSHOT
>  *tools/virsh-snapshot.c:
>     - add support for VIR_DOMAIN_SNAPSHOT_CREATE_PAUSE
>  *tools/virsh.pod:
>     - add docs for --pause option added to use
>     VIR_DOMAIN_SNAPSHOT_CREATE_PAUSE flag

You'll therefore need to rework this patch into selecting
VIR_DOMAIN_SNAPSHOT_CREATE_LIVE with opposite semantics, and default to
paused.

> ---
>  include/libvirt/libvirt.h.in |  4 ++++
>  tools/virsh-domain-monitor.c |  2 ++
>  tools/virsh-snapshot.c       |  6 ++++++
>  tools/virsh.pod              | 12 ++++++++++--
>  4 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
> index 81f12a4..376d6d5 100644
> --- a/include/libvirt/libvirt.h.in
> +++ b/include/libvirt/libvirt.h.in
> @@ -179,6 +179,7 @@ typedef enum {
>      VIR_DOMAIN_PAUSED_WATCHDOG = 6,     /* paused due to a watchdog event */
>      VIR_DOMAIN_PAUSED_FROM_SNAPSHOT = 7, /* paused after restoring from snapshot */
>      VIR_DOMAIN_PAUSED_SHUTTING_DOWN = 8, /* paused during shutdown process */
> +    VIR_DOMAIN_PAUSED_SNAPSHOT = 9,      /* paused while creating a snaphot */

Eep - VIR_DOMAIN_PAUSED_FROM_SNAPSHOT and VIR_DOMAIN_PAUSED_SNAPSHOT -
do we really need two values?  I'd rather you just reuse the existing value.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121010/8c06dfdc/attachment-0001.sig>


More information about the libvir-list mailing list