From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAILF-0003LH-VP for qemu-devel@nongnu.org; Thu, 14 Apr 2011 04:56:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAILF-0008VW-1G for qemu-devel@nongnu.org; Thu, 14 Apr 2011 04:55:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAILE-0008VR-P2 for qemu-devel@nongnu.org; Thu, 14 Apr 2011 04:55:56 -0400 Message-ID: <4DA6B72D.6080701@redhat.com> Date: Thu, 14 Apr 2011 10:58:21 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1302706307-16627-1-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1302706307-16627-1-git-send-email-stefanha@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu-img: allow rebase to a NULL backing file when unsafe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Anthony Liguori , qemu-devel@nongnu.org Am 13.04.2011 16:51, schrieb Stefan Hajnoczi: > From: Anthony Liguori > > 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 > Signed-off-by: Stefan Hajnoczi > --- > 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