From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUCdU-0004Fh-TL for qemu-devel@nongnu.org; Thu, 10 Oct 2013 05:34:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUCdO-0002tq-UO for qemu-devel@nongnu.org; Thu, 10 Oct 2013 05:34:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUCdO-0002tb-LT for qemu-devel@nongnu.org; Thu, 10 Oct 2013 05:34:18 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9A9YG3L017603 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Oct 2013 05:34:17 -0400 From: Max Reitz Date: Thu, 10 Oct 2013 11:09:26 +0200 Message-Id: <1381396168-12526-5-git-send-email-mreitz@redhat.com> In-Reply-To: <1381396168-12526-1-git-send-email-mreitz@redhat.com> References: <1381396168-12526-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v2 4/6] qcow2: Array assigning options to OL check bits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz Add an array which assigns the option string to its corresponding overlap check bit. Signed-off-by: Max Reitz --- block/qcow2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index 1e29bc8..eb17c2a 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -404,6 +404,17 @@ static QemuOptsList qcow2_runtime_opts = { }, }; +static const char *overlap_bool_option_names[QCOW2_OL_MAX_BITNR] = { + [QCOW2_OL_MAIN_HEADER_BITNR] = QCOW2_OPT_OVERLAP_MAIN_HEADER, + [QCOW2_OL_ACTIVE_L1_BITNR] = QCOW2_OPT_OVERLAP_ACTIVE_L1, + [QCOW2_OL_ACTIVE_L2_BITNR] = QCOW2_OPT_OVERLAP_ACTIVE_L2, + [QCOW2_OL_REFCOUNT_TABLE_BITNR] = QCOW2_OPT_OVERLAP_REFCOUNT_TABLE, + [QCOW2_OL_REFCOUNT_BLOCK_BITNR] = QCOW2_OPT_OVERLAP_REFCOUNT_BLOCK, + [QCOW2_OL_SNAPSHOT_TABLE_BITNR] = QCOW2_OPT_OVERLAP_SNAPSHOT_TABLE, + [QCOW2_OL_INACTIVE_L1_BITNR] = QCOW2_OPT_OVERLAP_INACTIVE_L1, + [QCOW2_OL_INACTIVE_L2_BITNR] = QCOW2_OPT_OVERLAP_INACTIVE_L2, +}; + static int qcow2_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { -- 1.8.3.1