From: Eric Blake <eblake@redhat.com>
To: Richard Palethorpe <richiejp@f-m.fm>, qemu-devel@nongnu.org
Cc: quintela@redhat.com, dgilbert@redhat.com, armbru@redhat.com,
rpalethorpe@suse.com
Subject: Re: [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI
Date: Mon, 8 Jan 2018 07:52:35 -0600 [thread overview]
Message-ID: <fd5f5f12-e081-6f19-54af-3b560139bb78@redhat.com> (raw)
In-Reply-To: <20180107122336.29333-1-richiejp@f-m.fm>
[-- Attachment #1: Type: text/plain, Size: 4912 bytes --]
On 01/07/2018 06:23 AM, Richard Palethorpe wrote:
> Add QAPI wrapper functions for the existing snapshot functionality. These
> functions behave the same way as the HMP savevm, loadvm and delvm
> commands. This will allow applications, such as OpenQA, to programmatically
> revert the VM to a previous state with no dependence on HMP or qemu-img.
That's already possible; libvirt uses QMP's human-monitor-command to
access these HMP commands programmatically.
We've had discussions in the past about what it would take to have
specific QMP commands for these operations; the biggest problem is that
these commands promote the use of internal snapshots, and there are
enough performance and other issues with internal snapshots that we are
not yet ready to commit to a long-term interface for making their use
easier. At this point, our recommendation is to prefer external snapshots.
https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg02427.html is
an example thread that has tried to tackle the QMP-ification of these
HMP commands in the past; here we are two years later, and I'm still not
sure we are ready.
I'm worried that taking this commands as-is will bake in an interface
that we don't want to support in the long term. In particular, the
qemu-img counterpart of taking an internal snapshot of an offline guest
is different from QMP context where the guest is running and would
always include a snapshot of CPU state in addition to disk state; I'm
also worried that the command is too broad, compared to doing a
transaction built on lower-level building blocks (take an internal
snapshot of disk storage, coupled with take an internal snapshot of cpu
state to be placed into a particular BDS); the HMP command is a bit hard
to use because the internal snapshot of CPU state has no user control
over which BDS will actually hold the state (other than which disk was
installed/hot-plugged first), whereas at the lower level, we probably do
want to allow management more fine-grained control over where the
internal snapshot lands.
Also, when sending a two-patch series, be sure to include a 0/2 cover
letter. More patch submission hints at
https://wiki.qemu.org/Contribute/SubmitAPatch
>
> I used the term snapshot instead of VM because I think it is less ambiguous
> and matches the internal function names.
>
> Signed-off-by: Richard Palethorpe <richiejp@f-m.fm>
> ---
> migration/savevm.c | 27 ++++++++++++++++++++++
> qapi-schema.json | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 93 insertions(+)
>
> +++ b/qapi-schema.json
> @@ -1125,6 +1125,72 @@
> { 'command': 'pmemsave',
> 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
>
> +##
> +# @save-snapshot:
> +#
> +# Save a snapshot of the entire Virtual Machine
> +#
> +# @name: A string identifying the snapshot. This can later be used with
> +# @load-snapshot or @delete-snapshot
> +#
> +# Since: 2.12.0
> +#
> +# Returns: If successful, nothing
> +#
> +# Notes: The equivalent HMP command is savevm. This stores all of the virtual
I don't see why we have to document HMP commands in the QMP document.
> +# machine's current state within the virtual machine's
> +# image(s)/storage. If the VM is currently running, this includes the
> +# state of the CPU and RAM. Later the VM can be reverted to this state.
How would the VM _not_ be currently running at the point where QMP can
be executed?
> +#
> +# qemu-img can also be used to manipulate snapshots.
> +#
> +# Examples:
> +#
> +# -> { "execute": "save-snapshot", "arguments": { "name": "lastgood" } }
> +# <- { "return": {} }
> +##
> +{ 'command': 'save-snapshot',
> + 'data': {'name': 'str'} }
> +
> +##
> +# @load-snapshot:
> +#
> +# Load a snapshot of the entire Virtual Machine, completely reverting it to
> +# that state
> +#
> +# Since: 2.12.0
> +#
> +# Returns: If successful, nothing
> +#
> +# Notes: The equivalent HMP command is loadvm. See the @save-snapshot notes.
> +#
> +# Examples:
> +#
> +# -> { "execute": "load-snapshot", "arguments": { "name": "lastgood" } }
> +# <- { "return": {} }
> +##
> +{ 'command': 'load-snapshot',
> + 'data': {'name': 'str'} }
> +
> +##
> +# @delete-snapshot:
> +#
> +# Delete a VM snapshot
> +#
> +# Since: 2.12.0
> +#
> +# Returns: If successful, nothing
> +#
> +# Notes: The equivalent HMP command is delvm. See the @save-snapshot notes.
> +#
> +# Examples:
> +#
> +# -> { "execute": "delete-snapshot", "arguments": { "name": "lastgood" } }
> +# <- { "return": {} }
> +##
> +{ 'command': 'delete-snapshot',
> + 'data': {'name': 'str'} }
> +
> ##
> # @cont:
> #
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2018-01-08 13:52 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-07 12:23 [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI Richard Palethorpe
2018-01-07 12:23 ` [Qemu-devel] [PATCH 2/2] Add test cases for saving, loading and deleting snapshots using QAPI Richard Palethorpe
2018-01-08 13:52 ` Eric Blake [this message]
2018-01-10 16:19 ` [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI Richard Palethorpe
2018-01-10 16:48 ` Eric Blake
2018-02-03 13:28 ` Markus Armbruster
2018-01-11 12:46 ` Max Reitz
2018-01-11 13:04 ` Daniel P. Berrange
2018-01-11 13:23 ` Dr. David Alan Gilbert
2018-01-11 13:36 ` Daniel P. Berrange
2018-01-11 16:55 ` Juan Quintela
2018-02-12 13:25 ` Richard Palethorpe
2018-02-13 10:50 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2018-02-13 11:43 ` Dr. David Alan Gilbert
2018-02-13 11:51 ` Daniel P. Berrangé
2018-02-13 13:20 ` Kevin Wolf
2018-02-13 13:25 ` Daniel P. Berrangé
[not found] ` <20180213143001.GA2354@rkaganb.sw.ru>
2018-02-13 14:36 ` Daniel P. Berrangé
2018-02-13 14:45 ` Kevin Wolf
2018-02-13 14:48 ` Daniel P. Berrangé
2018-02-13 14:51 ` Denis V. Lunev
2018-02-13 14:59 ` Dr. David Alan Gilbert
2018-02-13 15:01 ` Denis V. Lunev
2018-02-13 15:05 ` Dr. David Alan Gilbert
[not found] ` <20180213151352.GF2307@rkaganb.sw.ru>
2018-02-13 15:27 ` Dr. David Alan Gilbert
2018-02-13 15:29 ` Denis V. Lunev
2018-02-13 16:01 ` Denis Plotnikov
2018-02-15 15:21 ` Dr. David Alan Gilbert
2018-02-13 16:46 ` Eric Blake
2018-02-13 19:45 ` Denis V. Lunev
2018-02-13 14:43 ` Kevin Wolf
2018-02-13 14:50 ` Denis V. Lunev
2018-02-13 14:58 ` Daniel P. Berrangé
2018-02-13 15:23 ` Kevin Wolf
2018-02-13 15:30 ` Daniel P. Berrangé
2018-02-13 15:51 ` Kevin Wolf
2018-02-13 16:14 ` Denis Plotnikov
2018-01-10 6:17 ` [Qemu-devel] " Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fd5f5f12-e081-6f19-54af-3b560139bb78@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=richiejp@f-m.fm \
--cc=rpalethorpe@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).