qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v6 3/4] block: add a 'blockdev-snapshot' QMP command
Date: Tue, 22 Sep 2015 18:38:27 +0200	[thread overview]
Message-ID: <56018403.5040209@redhat.com> (raw)
In-Reply-To: <8cc989a360a5fe38839144946c878fb9f8c6a6d5.1442928283.git.berto@igalia.com>

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

On 22.09.2015 15:28, Alberto Garcia wrote:
> One of the limitations of the 'blockdev-snapshot-sync' command is that
> it does not allow passing BlockdevOptions to the newly created
> snapshots, so they are always opened using the default values.
> 
> Extending the command to allow passing options is not a practical
> solution because there is overlap between those options and some of
> the existing parameters of the command.
> 
> This patch introduces a new 'blockdev-snapshot' command with a simpler
> interface: it just takes two references to existing block devices that
> will be used as the source and target for the snapshot.
> 
> Since the main difference between the two commands is that one of them
> creates and opens the target image, while the other uses an already
> opened one, the bulk of the implementation is shared.
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> ---
>  blockdev.c           | 163 ++++++++++++++++++++++++++++++++-------------------
>  qapi-schema.json     |   2 +
>  qapi/block-core.json |  28 +++++++++
>  qmp-commands.hx      |  38 ++++++++++++
>  4 files changed, 171 insertions(+), 60 deletions(-)
> 

[snip]

> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index 495670b..e5bd0e0 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -1454,6 +1454,44 @@ Example:
>  EQMP
>  
>      {
> +        .name       = "blockdev-snapshot",
> +        .args_type  = "node:s,overlay:s",
> +        .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot,

As of 7fad30f06eb6aa57aaa8f3d264288f24ae7646f0, this needs to be
qmp_marshal_blockdev_snapshot.

> +    },
> +
> +SQMP
> +blockdev-snapshot
> +-----------------
> +Since 2.5
> +
> +Create a snapshot, by installing 'node' as the backing image of
> +'overlay'. Additionally, if 'node' is associated with a block
> +device, the block device changes to using 'overlay' as its new active
> +image.
> +
> +Arguments:
> +
> +- "node": device that will have a snapshot created (json-string)
> +- "overlay": device that will have 'node' as its backing image (json-string)
> +
> +Example:
> +
> +-> { "execute": "blockdev-add",
> +                "arguments": { "options": { "driver": "qcow2",
> +                                            "node-name": "node1534",
> +                                            "file": { "driver": "file",
> +                                                      "filename": "hd1.qcow2" },
> +                                            "backing": "" } } }
> +
> +<- { "return": {} }
> +
> +-> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
> +                                                    "overlay": "node1534" } }
> +<- { "return": {} }
> +
> +EQMP
> +
> +    {
>          .name       = "blockdev-snapshot-internal-sync",
>          .args_type  = "device:B,name:s",
>          .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,

Consequently, this context needs to be fixed up, too.

With that changed:

Reviewed-by: Max Reitz <mreitz@redhat.com>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-09-22 16:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 13:28 [Qemu-devel] [PATCH v6 0/4] Add 'blockdev-snapshot' command Alberto Garcia
2015-09-22 13:28 ` [Qemu-devel] [PATCH v6 1/4] block: rename BlockdevSnapshot to BlockdevSnapshotSync Alberto Garcia
2015-10-06 15:31   ` Kevin Wolf
2015-09-22 13:28 ` [Qemu-devel] [PATCH v6 2/4] block: support passing 'backing': '' to 'blockdev-add' Alberto Garcia
2015-10-06 15:31   ` Kevin Wolf
2015-09-22 13:28 ` [Qemu-devel] [PATCH v6 3/4] block: add a 'blockdev-snapshot' QMP command Alberto Garcia
2015-09-22 16:38   ` Max Reitz [this message]
2015-09-23  8:59     ` Alberto Garcia
2015-10-06 15:30   ` Kevin Wolf
2015-10-06 15:49     ` Alberto Garcia
2015-10-07  7:34       ` Kevin Wolf
2015-09-22 13:28 ` [Qemu-devel] [PATCH v6 4/4] block: add tests for the 'blockdev-snapshot' command Alberto Garcia
2015-09-22 16:54   ` Max Reitz

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=56018403.5040209@redhat.com \
    --to=mreitz@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).