[libvirt] [PATCHv3 3/5] snapshot: Add flag VIR_DOMAIN_SNAPSHOT_REVERT_STOPPED
Eric Blake
eblake at redhat.com
Tue Nov 13 23:39:22 UTC 2012
On 11/12/2012 10:49 AM, Peter Krempa wrote:
> The current snapshot reverting api supported changing the state of the
> machine after the snapshot was reverted to either started or paused.
>
> This patch adds the ability to revert the state but to stopped state.
> ---
> - fixed libvirt.c and virsh.pod docs.
> ---
> include/libvirt/libvirt.h.in | 1 +
> src/libvirt.c | 31 ++++++++++++++++---------------
> tools/virsh-snapshot.c | 3 +++
> tools/virsh.pod | 15 +++++++++------
> 4 files changed, 29 insertions(+), 21 deletions(-)
>
> + * Normally, the domain will revert to the same state the domain was in while
> + * the snapshot was taken (whether inactive, running, or paused), except that
> + * disk snapshots default to reverting to inactive state. Including
> + * VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING in @flags overrides the snapshot state to
> + * guarantee a running domain after the revert; or including
> + * VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED in @flags guarantees a paused domain after
> + * the revert. With VIR_DOMAIN_SNAPSHOT_REVERT_STOPPED contained in the flags
> + * the domain's memory state is not restored. These three flags are mutually
> + * exclusive. While a persistent domain does not need either flag, it is not
> + * possible to revert a transient domain into an inactive state, so transient
> + * domains require the use of one of these two flags.
Change the last sentence:
While a persistent domain does not need any of these flags, it is not
possible to revert a transient domain into an inactive state, so
transient domains require the use of either the running or paused flag.
> =item B<snapshot-revert> I<domain> {I<snapshot> | I<--current>}
> -[{I<--running> | I<--paused>}] [I<--force>]
> +[{I<--running> | I<--paused> | I<--stopped>}] [I<--force>]
>
> Revert the given domain to the snapshot specified by I<snapshot>, or to
> the current snapshot with I<--current>. Be aware
> @@ -2833,11 +2833,14 @@ the original snapshot was taken.
>
> Normally, reverting to a snapshot leaves the domain in the state it was
> at the time the snapshot was created, except that a disk snapshot with
> -no vm state leaves the domain in an inactive state. Passing either the
> -I<--running> or I<--paused> flag will perform additional state changes
> -(such as booting an inactive domain, or pausing a running domain). Since
> -transient domains cannot be inactive, it is required to use one of these
> -flags when reverting to a disk snapshot of a transient domain.
> +no vm state leaves the domain in an inactive state. Passing one of the
> +I<--running>, I<--paused> or I<--stopped> flag will perform additional
> +state changes such as booting an inactive domain, pausing a running domain
> +or shutting the domain down after the snapshot is reverted. Since
> +transient domains cannot be inactive, it is required to use one of
> +I<--running> or I<--paused> flags when reverting to a disk snapshot of a
> +transient domain. The I<--stopped> flag cannot be used on snapshots
> +of transient domains.
But here you did fine.
ACK with the one tweak in libvirt.c.
--
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/20121113/2074560c/attachment-0001.sig>
More information about the libvir-list
mailing list