From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLHQw-0002VI-3T for qemu-devel@nongnu.org; Tue, 10 Feb 2015 15:29:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLHQu-0006wS-3F for qemu-devel@nongnu.org; Tue, 10 Feb 2015 15:29:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLHQt-0006wF-T8 for qemu-devel@nongnu.org; Tue, 10 Feb 2015 15:29:20 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1AKTJWQ006551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 10 Feb 2015 15:29:19 -0500 From: Max Reitz Date: Tue, 10 Feb 2015 15:28:52 -0500 Message-Id: <1423600146-7642-11-git-send-email-mreitz@redhat.com> In-Reply-To: <1423600146-7642-1-git-send-email-mreitz@redhat.com> References: <1423600146-7642-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v6 10/24] qcow2: Open images with refcount order != 4 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz No longer refuse to open images with a different refcount entry width than 16 bits; only reject images with a refcount width larger than 64 bits (which is prohibited by the specification). Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- block/qcow2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 830c903..e563a30 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -677,10 +677,10 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, int flags, } /* Check support for various header values */ - if (header.refcount_order != 4) { - report_unsupported(bs, errp, "%d bit reference counts", - 1 << header.refcount_order); - ret = -ENOTSUP; + if (header.refcount_order > 6) { + error_setg(errp, "Reference count entry width too large; may not " + "exceed 64 bits"); + ret = -EINVAL; goto fail; } s->refcount_order = header.refcount_order; -- 2.1.0