From: Pavel Hrdina <phrdina@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 13/18] qapi: Convert savevm
Date: Thu, 16 Aug 2012 12:16:23 +0200 [thread overview]
Message-ID: <502CC877.2020202@redhat.com> (raw)
In-Reply-To: <502BFD42.8070900@redhat.com>
On 08/15/2012 09:49 PM, Eric Blake wrote:
> On 08/15/2012 01:41 AM, Pavel Hrdina wrote:
>> Signed-off-by: Pavel Hrdina<phrdina@redhat.com>
>> ---
> I'm focusing my review more on the public interface (since that's what
> affects libvirt), and therefore glanced through 1 through 12 but did not
> pay close attention to them.
>
>> hmp-commands.hx | 2 +-
>> hmp.c | 10 ++++++++++
>> hmp.h | 1 +
>> qapi-schema.json | 19 +++++++++++++++++++
>> qmp-commands.hx | 29 +++++++++++++++++++++++++++++
>> savevm.c | 25 +++++++++----------------
>> sysemu.h | 1 -
>> 7 files changed, 69 insertions(+), 18 deletions(-)
>>
>> +
>> +void hmp_vm_snapshot_save(Monitor *mon, const QDict *qdict)
>> +{
>> + const char *name = qdict_get_try_str(qdict, "name");
> In the cover letter, you said "and for QMP you have to always provide
> name parameter" - but this says 'name' is optional and can still be
> empty (id only).
I said in cover letter that the last two patches introduce this
functionality.
>> +++ b/qapi-schema.json
>> @@ -2356,3 +2356,22 @@
>> # Since: 1.2.0
>> ##
>> { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
>> +
>> +##
>> +# @vm-snapshot-save:
>> +#
>> +# Create a snapshot of the whole virtual machine. If 'tag' is provided,
> 'tag' is a misnomer, since you list @name as the parameter name.
>
>> +# it is used as human readable identifier. If there is already a snapshot
>> +# with the same tag or ID, it is replaced.
>> +#
>> +# The VM is automatically stopped and resumed and saving a snapshot can take
>> +# a long time.
>> +#
>> +# @name: tag or id of new or existing snapshot
> Here, you document @name as required,
>
>> +#
>> +# Returns: Nothing on success
>> +# If an error occurs, GenericError with error message
>> +#
>> +# Since: 1.2
> We missed 1.2 hard freeze. This better be 1.3.
>
>> +##
>> +{ 'command': 'vm-snapshot-save', 'data': {'*name': 'str'} }
> but here, you listed it as '*name' meaning optional. I'm okay with
> leaving name optional, provided that it means that you end up allocating
> the next unique id. But if that's the case, then returning nothing is
> wrong; this command needs to return { 'id':'int', '*name':'str' }, so
> that the user knows what snapshot just got allocated.
If you apply whole patch-series, then you have to for QMP always provide
@name.
As I said above, this behaviour is introduced by last two patches.
>> +SQMP
>> +vm-snapshot-save
>> +------
>> +
>> +Create a snapshot of the whole virtual machine. If 'tag' is provided,
>> +it is used as human readable identifier. If there is already a snapshot
>> +with the same tag or ID, it is replaced.
>> +
>> +The VM is automatically stopped and resumed and saving a snapshot can take
>> +a long time.
> I don't like that this command can take a long time. Just today on
> #virt IRC, someone was complaining that 'savevm' HMP cannot be canceled.
> If we're going to create a new interface, it would be nicer to create a
> command that starts the save process and returns immediately, as well as
> commands to track progress, allow an early abort, and send an event on
> completion. The HMP 'savevm' interface can issue multiple QMP commands
> under the hood to continue with it's blocking behavior, but as long as
> we are fixing things, I think the QMP interface should be more powerful.
Well, I could try to do it...with this I'll probably introduce new
command vm-snapshot-save-cancel or vm-snaphsot-cancel as we have migrate
and migrate-cancel.
>> +
>> +Arguments:
>> +
>> +- "name": tag or id of new or existing snapshot
>> +
>> +Example:
>> +
>> +-> { "execute": "vm-snapshot-save", "arguments": { "name": "my_snapshot" } }
>> +<- { "return": {} }
> Again, you need to return the id of the just-created snapshot.
>
>> @@ -2176,21 +2174,20 @@ void do_savevm(Monitor *mon, const QDict *qdict)
>> }
>>
>> /* Delete old snapshots of the same name */
>> - if (name && del_existing_snapshots(name, NULL) < 0) {
>> + if (has_name && del_existing_snapshots(name, errp) < 0) {
> Here's hoping later in the series updates this to make saner decisions.
> (Maybe I should peruse the entire series before commenting on
> individual patches?)
>
next prev parent reply other threads:[~2012-08-16 10:16 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-15 7:41 [Qemu-devel] [PATCH 00/18] qapi: Convert savevm, loadvm, delvm and info snapshots Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 01/18] qerror: introduce QERR_GENERIC_ERROR Pavel Hrdina
2012-08-30 12:11 ` Luiz Capitulino
2012-09-06 8:34 ` Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 02/18] block: add error parameter to bdrv_snapshot_create() and related functions Pavel Hrdina
2012-08-30 14:47 ` Luiz Capitulino
2012-08-31 6:26 ` Markus Armbruster
2012-08-31 12:18 ` Kevin Wolf
2012-08-31 13:13 ` Luiz Capitulino
2012-08-31 13:09 ` Luiz Capitulino
2012-09-06 9:07 ` Pavel Hrdina
2012-09-10 17:03 ` Luiz Capitulino
2012-08-15 7:41 ` [Qemu-devel] [PATCH 03/18] block: add error parameter to bdrv_snapshot_goto() " Pavel Hrdina
2012-08-30 15:07 ` Luiz Capitulino
2012-08-15 7:41 ` [Qemu-devel] [PATCH 04/18] block: add error parameter to bdrv_snapshot_delete() " Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 05/18] block: add error parameter to bdrv_snapshot_list() " Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 06/18] block: add error parameter to bdrv_snapshot_find() Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 07/18] block: add error parameter to del_existing_snapshots() Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 08/18] savevm: add error parameter to qemu_savevm_state_begin() Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 09/18] savevm: add error parameter to qemu_savevm_state_iterate() Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 10/18] savevm: add error parameter to qemu_savevm_state_complete() Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 11/18] savevm: add error parameter to qemu_savevm_state() Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 12/18] savevm: add error parameter to qemu_loadvm_state() Pavel Hrdina
2012-08-30 17:09 ` Luiz Capitulino
2012-09-06 8:33 ` Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 13/18] qapi: Convert savevm Pavel Hrdina
2012-08-15 19:49 ` Eric Blake
2012-08-16 10:16 ` Pavel Hrdina [this message]
2012-08-15 7:41 ` [Qemu-devel] [PATCH 14/18] qapi: Convert loadvm Pavel Hrdina
2012-08-16 3:31 ` Eric Blake
2012-08-16 4:34 ` Eric Blake
2012-08-15 7:41 ` [Qemu-devel] [PATCH 15/18] qapi: Convert delvm Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 16/18] qapi: Convert info snapshots Pavel Hrdina
2012-08-16 4:36 ` Eric Blake
2012-08-16 10:17 ` Pavel Hrdina
2012-08-15 7:41 ` [Qemu-devel] [PATCH 17/18] hmp: allow "bool" parameter to be optional Pavel Hrdina
2012-08-16 4:39 ` Eric Blake
2012-08-15 7:41 ` [Qemu-devel] [PATCH 18/18] vm-snapshot-save: add force parameter Pavel Hrdina
2012-08-16 5:00 ` Eric Blake
2012-08-16 10:19 ` Pavel Hrdina
2012-08-30 17:15 ` [Qemu-devel] [PATCH 00/18] qapi: Convert savevm, loadvm, delvm and info snapshots Luiz Capitulino
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=502CC877.2020202@redhat.com \
--to=phrdina@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.