All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-img: allow rebase to a NULL backing file when unsafe
Date: Thu, 14 Apr 2011 10:58:21 +0200	[thread overview]
Message-ID: <4DA6B72D.6080701@redhat.com> (raw)
In-Reply-To: <1302706307-16627-1-git-send-email-stefanha@linux.vnet.ibm.com>

Am 13.04.2011 16:51, schrieb Stefan Hajnoczi:
> From: Anthony Liguori <aliguori@us.ibm.com>
> 
> QEMU can drop a backing file so that an image file no longer depends on
> the backing file, but this feature has not been exposed in qemu-img.
> This is useful in an image streaming usecase or when an image file has
> been fully allocated and no reads can hit the backing file anymore.
> 
> Since the dropping the backing file can make the image unusable, only
> allow this when the unsafe flag has been set.

I think it would also make sense to allow it in safe mode, it would have
the same effect as rebasing onto an empty new backing file. Might take
more than a one-liner, though.

In case you need a workaround for older qemu-img versions, -b "" works,
too (at least for qcow2).

> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> ---
>  qemu-img.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index d9c2c12..ed5ba91 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -1240,7 +1240,7 @@ static int img_rebase(int argc, char **argv)
>          }
>      }
>  
> -    if ((optind >= argc) || !out_baseimg) {
> +    if ((optind >= argc) || (!unsafe && !out_baseimg)) {
>          help();
>      }
>      filename = argv[optind++];

Thanks, applied to the block branch.

Kevin

      reply	other threads:[~2011-04-14  8:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-13 14:51 [Qemu-devel] [PATCH] qemu-img: allow rebase to a NULL backing file when unsafe Stefan Hajnoczi
2011-04-14  8:58 ` Kevin Wolf [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=4DA6B72D.6080701@redhat.com \
    --to=kwolf@redhat.com \
    --cc=aliguori@us.ibm.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 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.