From: Eric Blake <eblake@redhat.com>
To: Pavel Hrdina <phrdina@redhat.com>
Cc: lcapitulino@redhat.com, Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 00/11] convert savevm to use qapi and introduce qmp command
Date: Wed, 10 Apr 2013 06:24:11 -0600 [thread overview]
Message-ID: <516559EB.8020005@redhat.com> (raw)
In-Reply-To: <516544C3.2060306@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3332 bytes --]
On 04/10/2013 04:53 AM, Pavel Hrdina wrote:
> The first thing what we should discuss is the use of name as tak or
> id. I think that the best solution should be that we will have separate
> arguments of both. We will use the 'name' argument to specify the tag
> of a snapshot and we will add a new argument named 'id' to specify the
> id of the snapshot.
> There will be some restriction how to use them.
> - If you are creating new snapshot, you could use only the 'name'
> argument because the id will be generated.
This works.
> - If you want to overwrite an existing snapshot, you could specify
> the 'id' or the 'name' argument or both of them and also you will
> have to use the 'force' argument
But the argument made in this thread is that QMP should _not_ have a
force argument. It should be a flat-out error in QMP to try to create a
snapshot with a conflicting name or tag; preferably with a distinct
error type. Higher-level apps (HMP savevm -f) would try to create; if
-f is not specified, the error is good enough; if -f is specified and
that particular error is returned, then HMP calls delete and then
re-tries the create. No 'force' argument needed at the QMP layer.
> - I think that the 'name' argument don't need to be mandatory for QMP
> and also for HMP if we will generate the name.
Since HMP always generates a tag, and libvirt always generates a tag, I
think that teaching 'qemu-img' enough plumbing to modify the tag of an
existing snapshot will be sufficient for the purposes of testing loadvm
on a tagless snapshot. I'm starting to be convinced that having QMP
mandate a tag name, and leaving only qemu-img as the way to create a
tagless snapshot, makes more sense.
> - We always return/print information about created snapshot that
> everyone knows which snapshot has been created.
Thus, I'm leaning towards:
{ 'command': 'vm-snapshot-save',
'data': { 'tag': 'str', '*id': 'int' },
'returns': 'SnapshotInfo' }
Mandatory tag, optional id, no force flag.
Addition of a qemu-img snapshot subcommand, which can be used to alter
(including removing) the tag of an existing snapshot.
>
> The loadvm will use also both arguments and with this we will support
> snapshots without tags, because you can specify that you want load
> the snapshot by 'id'
Here, I could see two different options:
{ 'command': 'vm-snapshot-load',
'data': { '*name': 'str', '*id': 'int' } }
Optional name, optional id; with an additional semantic check that at
least one was provided, and that if both were provided that they name
the same snapshot (but JSON doesn't express this constraint). Or:
{ 'enum': 'SnapshotLookup',
'data': [ 'id-only', 'tag-only', 'default' ] }
{ 'command': 'vm-snapshot-load',
'data': { 'name': 'str', '*mode': 'SnapshotLookup' } }
where mode defaults to matching 'name' against first 'id' then 'tag',
but where 'id-only' and 'tag-only' can refine the search to force 'name'
to match only one of the two identifiers. Here, the only semantic
constraint that JSON cannot express is that 'name' must be the
stringized form of an integer for an id lookup to succeed.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-04-10 12:28 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-29 14:12 [Qemu-devel] [PATCH v4 00/11] convert savevm to use qapi and introduce qmp command Pavel Hrdina
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 01/11] block: add error parameter to bdrv_snapshot_create() and related functions Pavel Hrdina
2013-04-09 13:13 ` Markus Armbruster
2013-04-09 13:43 ` Kevin Wolf
2013-04-09 16:21 ` Markus Armbruster
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 02/11] block: add error parameter to del_existing_snapshots() Pavel Hrdina
2013-04-09 13:27 ` Markus Armbruster
2013-04-09 14:14 ` Luiz Capitulino
2013-04-10 9:57 ` Pavel Hrdina
2013-04-10 11:33 ` Markus Armbruster
2013-04-10 12:06 ` Eric Blake
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 03/11] savevm: add error parameter to qemu_savevm_state_begin() Pavel Hrdina
2013-04-09 13:34 ` Markus Armbruster
2013-04-09 13:37 ` Markus Armbruster
2013-04-09 13:47 ` Pavel Hrdina
2013-04-09 13:49 ` Markus Armbruster
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 04/11] savevm: add error parameter to qemu_savevm_state_iterate() Pavel Hrdina
2013-04-09 13:41 ` Markus Armbruster
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 05/11] savevm: add error parameter to qemu_savevm_state_complete() Pavel Hrdina
2013-04-09 13:56 ` Markus Armbruster
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 06/11] savevm: add error parameter to qemu_savevm_state() Pavel Hrdina
2013-04-09 14:00 ` Markus Armbruster
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 07/11] qapi: Convert savevm Pavel Hrdina
2013-03-29 16:12 ` Eric Blake
2013-03-29 16:21 ` Pavel Hrdina
2013-04-09 16:04 ` Markus Armbruster
2013-04-09 16:12 ` Eric Blake
2013-04-09 17:23 ` Markus Armbruster
2013-04-09 17:46 ` Eric Blake
2013-04-10 8:01 ` Markus Armbruster
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 08/11] qemu-img: introduce qemu_img_handle_error Pavel Hrdina
2013-04-09 16:10 ` Markus Armbruster
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 09/11] block: update return value from bdrv_snapshot_create Pavel Hrdina
2013-04-09 16:29 ` Markus Armbruster
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 10/11] savevm: update return value from qemu_savevm_state Pavel Hrdina
2013-04-09 16:32 ` Markus Armbruster
2013-03-29 14:12 ` [Qemu-devel] [PATCH v4 11/11] savevm: add force parameter to HMP command and return snapshot info Pavel Hrdina
2013-04-09 16:45 ` Markus Armbruster
2013-04-10 8:18 ` [Qemu-devel] [PATCH v4 00/11] convert savevm to use qapi and introduce qmp command Markus Armbruster
2013-04-10 10:53 ` Pavel Hrdina
2013-04-10 12:24 ` Eric Blake [this message]
2013-04-10 12:40 ` Luiz Capitulino
2013-04-10 12:49 ` Eric Blake
2013-04-10 13:22 ` Pavel Hrdina
2013-04-10 13:32 ` Luiz Capitulino
2013-04-10 13:50 ` Pavel Hrdina
2013-04-10 14:05 ` Pavel Hrdina
2013-04-10 17:15 ` Eric Blake
2013-04-10 17:33 ` Pavel Hrdina
2013-04-17 2:48 ` Wenchao Xia
2013-04-11 9:20 ` Markus Armbruster
2013-04-15 12:10 ` Kevin Wolf
2013-04-15 13:16 ` Eric Blake
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=516559EB.8020005@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=phrdina@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 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).