From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUeIp-0007s7-Jo for qemu-devel@nongnu.org; Fri, 11 Oct 2013 11:07:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUeIj-0005ky-Fl for qemu-devel@nongnu.org; Fri, 11 Oct 2013 11:06:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUeIj-0005kh-8W for qemu-devel@nongnu.org; Fri, 11 Oct 2013 11:06:49 -0400 From: Kevin Wolf Date: Fri, 11 Oct 2013 17:05:19 +0200 Message-Id: <1381503951-27985-30-git-send-email-kwolf@redhat.com> In-Reply-To: <1381503951-27985-1-git-send-email-kwolf@redhat.com> References: <1381503951-27985-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 29/61] qcow2: Array assigning options to OL check bits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Max Reitz Add an array which assigns the option string to its corresponding overlap check bit. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- block/qcow2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index a517e3d..eee7eaf 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.1.4