From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIyXl-00015y-AV for qemu-devel@nongnu.org; Mon, 09 Sep 2013 06:18:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VIyXd-0006xu-FM for qemu-devel@nongnu.org; Mon, 09 Sep 2013 06:18:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIyXd-0006xL-7t for qemu-devel@nongnu.org; Mon, 09 Sep 2013 06:17:57 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r89AHskZ002479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Sep 2013 06:17:55 -0400 From: Max Reitz Date: Mon, 9 Sep 2013 12:17:41 +0200 Message-Id: <1378721861-25552-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH] block/qcow2: Use bdrv_truncate for size amend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz 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; } -- 1.8.3.1