From 154566a3a7e0ef3a32650952a79031c8e5c5489c Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Mon, 4 Nov 2013 22:32:32 +0100 Subject: [PATCH 39/87] qcow2: Array assigning options to OL check bits RH-Author: Max Reitz Message-id: <1383604354-12743-42-git-send-email-mreitz@redhat.com> Patchwork-id: 55341 O-Subject: [RHEL-7.0 qemu-kvm PATCH 41/43] qcow2: Array assigning options to OL check bits Bugzilla: 1004347 RH-Acked-by: Kevin Wolf RH-Acked-by: Laszlo Ersek RH-Acked-by: Fam Zheng RH-Acked-by: Stefan Hajnoczi BZ: 1004347 Add an array which assigns the option string to its corresponding overlap check bit. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf (cherry picked from commit 4092e99d935fe26fd53631cc9e170f9a19e3ee4a) Signed-off-by: Max Reitz --- block/qcow2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) Signed-off-by: Miroslav Rezanina --- block/qcow2.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index c47286f..b6f300d 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.7.1