All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Cc: stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 3/3] block: Fix snapshot=on for protocol parsed from filename
Date: Fri, 04 Apr 2014 17:23:08 +0200	[thread overview]
Message-ID: <533ECE5C.4050404@redhat.com> (raw)
In-Reply-To: <1396623360-6437-1-git-send-email-kwolf@redhat.com>

On 04.04.2014 16:56, Kevin Wolf wrote:
> Since commit 9fd3171a, BDRV_O_SNAPSHOT uses an option QDict to specify
> the originally requested image as the backing file of the newly created
> temporary snapshot. This means that the filename is stored in
> "file.filename", which is an option that is not parsed for protocol
> names. Therefore things like -drive file=nbd:localhost:10809 were
> broken because it looked for a local file with the literal name
> 'nbd:localhost:10809'.
>
> This patch changes the way BDRV_O_SNAPSHOT works once again. We now open
> the originally requested image as normal, and then do a similar
> operation as for live snapshots to put the temporary snapshot on top.
> This way, both driver specific options and parsed filenames work.
>
> As a nice side effect, this results in code movement to factor
> bdrv_append_temp_snapshot() out. This is a good preparation for moving
> its call to drive_init() and friends eventually.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> v2:
> - open the backing file for the temporary snapshot read-only from the
>    beginning so that you can get an r/w block device from a read-only
>    file using snapshot=on. Gets rid of the bdrv_reopen() whose return
>    value was ignored in v1, too.
>
>   block.c                    | 148 ++++++++++++++++++++++++---------------------
>   include/block/block.h      |   1 +
>   tests/qemu-iotests/051     |   8 +++
>   tests/qemu-iotests/051.out |  28 +++++++++
>   4 files changed, 115 insertions(+), 70 deletions(-)

Together with "block: Check bdrv_getlength() return value in 
bdrv_append_temp_snapshot()":

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

      reply	other threads:[~2014-04-04 15:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 12:03 [Qemu-devel] [PATCH for-2.0 0/3] bdrv_open() fixes Kevin Wolf
2014-04-04 12:03 ` [Qemu-devel] [PATCH 1/3] block: Don't parse 'filename' option Kevin Wolf
2014-04-04 13:45   ` Max Reitz
2014-04-04 12:03 ` [Qemu-devel] [PATCH 2/3] qemu-iotests: Remove CR line endings in reference output Kevin Wolf
2014-04-04 13:47   ` Max Reitz
2014-04-04 12:03 ` [Qemu-devel] [PATCH 3/3] block: Fix snapshot=on for protocol parsed from filename Kevin Wolf
2014-04-04 14:38   ` Max Reitz
2014-04-04 15:04     ` Kevin Wolf
2014-04-04 14:56   ` [Qemu-devel] [PATCH v2 " Kevin Wolf
2014-04-04 15:23     ` Max Reitz [this message]

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=533ECE5C.4050404@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --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 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.