qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kwolf@redhat.com, fsimonce@redhat.com, jcody@redhat.com,
	qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync
Date: Wed, 29 Feb 2012 11:41:10 -0700	[thread overview]
Message-ID: <4F4E7146.2020406@redhat.com> (raw)
In-Reply-To: <1330522650-15357-4-git-send-email-pbonzini@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3714 bytes --]

On 02/29/2012 06:37 AM, Paolo Bonzini wrote:
> We will add other kinds of operation.  Prepare for this by adjusting
> the schema and renaming some types/variables.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  blockdev.c       |   73 +++++++++++++++++++++++++++++------------------------
>  qapi-schema.json |   33 ++++++++++++++++--------
>  qmp-commands.hx  |   51 ++++++++++++++++++++-----------------
>  3 files changed, 90 insertions(+), 67 deletions(-)
> 

>  ##
> -# @blockdev-group-snapshot-sync
> +# @blockdev-transaction
>  #
> -# Generates a synchronous snapshot of a group of one or more block devices,
> -# as atomically as possible.  If the snapshot of any device in the group
> -# fails, then the entire group snapshot will be abandoned and the
> -# appropriate error returned.
> +# Atomically operate on a group of one or more block devices.  If
> +# any operation fails, then the entire set of actions will be
> +# abandoned and the appropriate error returned.  The only operation
> +# supported is currently snapshot.
>  #
>  #  List of:
> -#  @SnapshotDev: information needed for the device snapshot
> +#  @BlockdevAction: information needed for the device snapshot

>  Arguments:
>  
> -devlist array:
> -    - "device": device name to snapshot (json-string)
> -    - "snapshot-file": name of new image file (json-string)
> -    - "format": format of new image (json-string, optional)
> +actions array:
> +    - "type": the operation to perform.  The only supported
> +      value is "snapshot". (json-string)
> +    - "data": a dictionary.  The contents depend on the value
> +      of "type".  When "type" is "snapshot":
> +      - "device": device name to snapshot (json-string)
> +      - "snapshot-file": name of new image file (json-string)
> +      - "format": format of new image (json-string, optional)

I like it.  Of course, this means I still have a moving target for
implementing the libvirt side of things, so I'd like consensus sooner
rather than later.  More importantly, as long as
blockdev-group-snapshot-sync is not part of a release, renaming it is
fine; but if we get to the qemu 1.1 release with Jeff's patches but not
Paolo's rename, then libvirt has a harder job to cope with both names.


>  
>  Example:
>  
> --> { "execute": "blockdev-group-snapshot-sync", "arguments":
> -                      { "devlist": [{ "device": "ide-hd0",
> -                                      "snapshot-file": "/some/place/my-image",
> -                                      "format": "qcow2" },
> -                                    { "device": "ide-hd1",
> -                                      "snapshot-file": "/some/place/my-image2",
> -                                      "format": "qcow2" }] } }
> +-> { "execute": "blockdev-transaction",
> +     "arguments": { "actions": [
> +         { 'type': 'snapshot, 'data' : { "device": "ide-hd0",
> +                                         "snapshot-file": "/some/place/my-image",
> +                                         "format": "qcow2" } },
> +         { 'type': 'snapshot, 'data' : { "device": "ide-hd1",
> +                                         "snapshot-file": "/some/place/my-image2",
> +                                         "format": "qcow2",
> +                                         "op": "snapshot" } } ] } }

Drop the "op":"snapshot".  It's a leftover from before your conversion
to a union type.

Question - when reading/writing these examples, are 'type' and "type"
interchangeable (like in XML)?

-- 
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: 620 bytes --]

  parent reply	other threads:[~2012-02-29 18:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29 13:37 [Qemu-devel] [PATCH 0/6] Mirrored writes using blockdev-transaction Paolo Bonzini
2012-02-29 13:37 ` [Qemu-devel] [PATCH 1/6] fix format name for backing file Paolo Bonzini
2012-02-29 13:37 ` [Qemu-devel] [PATCH 2/6] qapi: complete implementation of unions Paolo Bonzini
2012-02-29 13:37 ` [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync Paolo Bonzini
2012-02-29 14:25   ` Paolo Bonzini
2012-02-29 15:08     ` Luiz Capitulino
2012-02-29 15:23       ` Paolo Bonzini
2012-03-01 13:30         ` Luiz Capitulino
2012-03-01 13:33           ` Paolo Bonzini
2012-02-29 18:41   ` Eric Blake [this message]
2012-03-01 10:18     ` Paolo Bonzini
2012-02-29 13:37 ` [Qemu-devel] [PATCH 4/6] add reuse field Paolo Bonzini
2012-02-29 18:50   ` Eric Blake
2012-03-01 10:22     ` Kevin Wolf
2012-02-29 13:37 ` [Qemu-devel] [PATCH 5/6] Add blkmirror block driver Paolo Bonzini
2012-02-29 14:37   ` Stefan Hajnoczi
2012-02-29 14:56     ` Paolo Bonzini
2012-02-29 19:36   ` Eric Blake
2012-02-29 13:37 ` [Qemu-devel] [PATCH 6/6] add mirroring to blockdev-transaction Paolo Bonzini
2012-02-29 19:47   ` Eric Blake
2012-03-01  6:46     ` Paolo Bonzini

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=4F4E7146.2020406@redhat.com \
    --to=eblake@redhat.com \
    --cc=fsimonce@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.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).