From: Juan Quintela <quintela@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>,
"Denis V. Lunev" <den@openvz.org>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/5] qmp: create qmp_savevm command
Date: Wed, 18 Nov 2015 12:36:08 +0100 [thread overview]
Message-ID: <87mvubmtef.fsf@emacs.mitica> (raw)
In-Reply-To: <87ziyd0wdm.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Tue, 17 Nov 2015 11:10:29 +0100")
Markus Armbruster <armbru@redhat.com> wrote:
> "Denis V. Lunev" <den@openvz.org> writes:
>
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> CC: Juan Quintela <quintela@redhat.com>
>> CC: Amit Shah <amit.shah@redhat.com>
>> CC: Markus Armbruster <armbru@redhat.com>
>> CC: Eric Blake <eblake@redhat.com>
>> ---
>> migration/savevm.c | 5 +++++
>> qapi-schema.json | 13 +++++++++++++
>> qmp-commands.hx | 25 +++++++++++++++++++++++++
>> 3 files changed, 43 insertions(+)
>>
>> diff --git a/migration/savevm.c b/migration/savevm.c
>> index f83ffd0..565b10a 100644
>> --- a/migration/savevm.c
>> +++ b/migration/savevm.c
>> @@ -2010,6 +2010,11 @@ void hmp_savevm(Monitor *mon, const QDict *qdict)
>> }
>> }
>>
>> +void qmp_savevm(bool has_name, const char *name, Error **errp)
>> +{
>> + do_savevm(has_name ? name : NULL, errp);
>> +}
>> +
>
> Please name do_savevm() qmp_savevm() and drop this wrapper.
>
> We're working on omitting has_FOO for pointer-valued FOO.
Agreed.
>
>> void qmp_xen_save_devices_state(const char *filename, Error **errp)
>> {
>> QEMUFile *f;
>> diff --git a/qapi-schema.json b/qapi-schema.json
>> index b65905f..8cc8b44 100644
>> --- a/qapi-schema.json
>> +++ b/qapi-schema.json
>> @@ -3962,3 +3962,16 @@
>> ##
>> { 'enum': 'ReplayMode',
>> 'data': [ 'none', 'record', 'play' ] }
>> +
>> +##
>> +# @savevm
>> +#
>> +# Save a VM snapshot. Without a name new snapshot is created",
>> +#
>> +# @name: identifier of a snapshot to be created
>
> Missing #optional tag.
>
> What happens when @name is missing?
Why are we allowing this? QMP is going to be called by libvirt or
similar, they can choose a name, thanks very much.
> What happens when @name names an existing snapshot?
We remove them.
/* Delete old snapshots of the same name */
if (name && del_existing_snapshots(mon, name) < 0) {
goto the_end;
}
I think we should give one error. Let the hmp code remove them.
I would preffer to change the interface to "require" a flag if we want
it to be removed. But requiring a flag is the equivalent of requiring
qmp_deletevm
qmp_savevm
or whatever they are called.
> Do we want @name to be optional in QMP? I dimly remember ambiguity
> problems between names and IDs. Perhaps it'll become clear later in the
> series.
Again, I think that requiring a name is the best thing to do. Libvirt,
openstack and friends are good at choosen names, qemu is not.
> The QMP interface needs to make sense on its own, even if that means
> deviating from HMP. Juan, Amit, do you have opinions on the proper QMP
> interface for internal snapshots?
I agree that the "requirement" of a name is a good idea. Not deleting
the existing snapshots looks like a good idea also. It is not difficult
to romeve them previously.
Thanks, Juan.
next prev parent reply other threads:[~2015-11-18 11:36 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-16 15:32 [Qemu-devel] [PATCH 0/5] QMP wrappers for VM snapshot operations Denis V. Lunev
2015-11-16 15:32 ` [Qemu-devel] [PATCH 1/5] migration: split hmp_savevm to do_savevm and hmp_savevm wrapper Denis V. Lunev
2015-11-17 8:56 ` Markus Armbruster
2015-11-18 11:29 ` Juan Quintela
2015-11-16 15:32 ` [Qemu-devel] [PATCH 2/5] qmp: create qmp_savevm command Denis V. Lunev
2015-11-17 10:10 ` Markus Armbruster
2015-11-18 11:36 ` Juan Quintela [this message]
2015-12-01 14:28 ` Denis V. Lunev
2015-12-01 15:01 ` Eric Blake
2015-12-01 15:03 ` Markus Armbruster
2015-12-01 14:29 ` Denis V. Lunev
2015-12-01 15:05 ` Markus Armbruster
2015-12-01 15:18 ` Denis V. Lunev
2015-11-16 15:32 ` [Qemu-devel] [PATCH 3/5] qmp: create qmp_delvm command Denis V. Lunev
2015-11-17 10:14 ` Markus Armbruster
2015-11-18 11:37 ` Juan Quintela
2015-11-18 11:37 ` Juan Quintela
2015-11-16 15:32 ` [Qemu-devel] [PATCH 4/5] migration: improve error reporting for hmp_loadvm Denis V. Lunev
2015-11-17 10:34 ` Markus Armbruster
2015-11-16 15:32 ` [Qemu-devel] [PATCH 5/5] qmp: create QMP implementation of loadvm command Denis V. Lunev
2015-11-18 11:41 ` Juan Quintela
2015-12-01 15:19 ` Denis V. Lunev
2015-11-17 10:33 ` [Qemu-devel] [PATCH 0/5] QMP wrappers for VM snapshot operations Markus Armbruster
2015-11-17 10:44 ` Denis V. Lunev
-- strict thread matches above, loose matches on Subject: below --
2015-12-04 14:44 [Qemu-devel] [PATCH v2 for 2.6 " Denis V. Lunev
2015-12-04 14:44 ` [Qemu-devel] [PATCH 2/5] qmp: create qmp_savevm command Denis V. Lunev
2015-12-23 21:40 ` Eric Blake
2015-12-23 21:45 ` Denis V. Lunev
2016-01-08 13:19 ` Denis V. Lunev
2016-01-08 14:00 [Qemu-devel] [PATCH v3 0/5] QMP wrappers for VM snapshot operations Denis V. Lunev
2016-01-08 14:00 ` [Qemu-devel] [PATCH 2/5] qmp: create qmp_savevm command Denis V. Lunev
2016-01-08 14:10 [Qemu-devel] [PATCH v4 0/5] QMP wrappers for VM snapshot operations Denis V. Lunev
2016-01-08 14:10 ` [Qemu-devel] [PATCH 2/5] qmp: create qmp_savevm command Denis V. Lunev
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=87mvubmtef.fsf@emacs.mitica \
--to=quintela@redhat.com \
--cc=amit.shah@redhat.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--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 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).