From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRLbE-0001Gx-8M for qemu-devel@nongnu.org; Wed, 02 Oct 2013 08:32:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRLb5-000518-Rv for qemu-devel@nongnu.org; Wed, 02 Oct 2013 08:32:16 -0400 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:57950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRLb5-000510-Kx for qemu-devel@nongnu.org; Wed, 02 Oct 2013 08:32:07 -0400 Received: by mail-wg0-f51.google.com with SMTP id c11so775298wgh.6 for ; Wed, 02 Oct 2013 05:32:06 -0700 (PDT) Date: Wed, 2 Oct 2013 14:32:04 +0200 From: Stefan Hajnoczi Message-ID: <20131002123204.GE12200@stefanha-thinkpad.redhat.com> References: <1378721861-25552-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1378721861-25552-1-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH] block/qcow2: Use bdrv_truncate for size amend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On Mon, Sep 09, 2013 at 12:17:41PM +0200, Max Reitz wrote: > When amending the size option for a qcow2 image, use bdrv_truncate > instead of qcow2_truncate directly, since the latter will not adjust the > total_sectors count in the BDS structure (whereas the former will). > > Signed-off-by: Max Reitz > --- > Depends on (follow-up to): > - block/qcow2: Image file option amendment (series, v5) > --- > block/qcow2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/qcow2.c b/block/qcow2.c > index d29547b..259edfd 100644 > --- a/block/qcow2.c > +++ b/block/qcow2.c > @@ -1997,7 +1997,7 @@ static int qcow2_amend_options(BlockDriverState *bs, > } > > if (new_size) { > - ret = qcow2_truncate(bs, new_size); > + ret = bdrv_truncate(bs, new_size); > if (ret < 0) { > return ret; > } It seems this patch was already squashed into 9296b3ed7050cc6e0645fbc3b0aea74406d7eeb2 ("qcow2: Implement bdrv_amend_options").