cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
218e99
From c8fa26b697c9ca4fc90909e9c93471ea8b616c76 Mon Sep 17 00:00:00 2001
218e99
From: Kevin Wolf <kwolf@redhat.com>
218e99
Date: Wed, 17 Jul 2013 14:45:34 +0200
218e99
Subject: [PATCH 32/38] qcow2: Use dashes instead of underscores in options
218e99
218e99
Message-id: <1378736903-18489-33-git-send-email-kwolf@redhat.com>
218e99
Patchwork-id: 54219
218e99
O-Subject: [RHEL-7.0 qemu-kvm PATCH 32/32] qcow2: Use dashes instead of underscores in options
218e99
Bugzilla: 1005818
218e99
RH-Acked-by: Fam Zheng <famz@redhat.com>
218e99
RH-Acked-by: Max Reitz <mreitz@redhat.com>
218e99
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
218e99
Bugzilla: 1005818
218e99
218e99
This is what QMP wants to use. The options haven't been enabled in any
218e99
release yet, so we're still free to change them.
218e99
218e99
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
218e99
Reviewed-by: Eric Blake <eblake@redhat.com>
218e99
(cherry picked from commit 64aa99d3e0333dea73d7505190659a02ca909292)
218e99
218e99
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
218e99
---
218e99
 block/qcow2.c              |    2 +-
218e99
 block/qcow2.h              |    8 ++++----
218e99
 tests/qemu-iotests/051     |   14 +++++++-------
218e99
 tests/qemu-iotests/051.out |   30 +++++++++++++++---------------
218e99
 4 files changed, 27 insertions(+), 27 deletions(-)
218e99
218e99
diff --git a/block/qcow2.c b/block/qcow2.c
218e99
index 9383990..abdc202 100644
218e99
--- a/block/qcow2.c
218e99
+++ b/block/qcow2.c
218e99
@@ -291,7 +291,7 @@ static QemuOptsList qcow2_runtime_opts = {
218e99
     .head = QTAILQ_HEAD_INITIALIZER(qcow2_runtime_opts.head),
218e99
     .desc = {
218e99
         {
218e99
-            .name = "lazy_refcounts",
218e99
+            .name = QCOW2_OPT_LAZY_REFCOUNTS,
218e99
             .type = QEMU_OPT_BOOL,
218e99
             .help = "Postpone refcount updates",
218e99
         },
218e99
diff --git a/block/qcow2.h b/block/qcow2.h
218e99
index 3b2d5cd..dba9771 100644
218e99
--- a/block/qcow2.h
218e99
+++ b/block/qcow2.h
218e99
@@ -59,10 +59,10 @@
218e99
 #define DEFAULT_CLUSTER_SIZE 65536
218e99
 
218e99
 
218e99
-#define QCOW2_OPT_LAZY_REFCOUNTS "lazy_refcounts"
218e99
-#define QCOW2_OPT_DISCARD_REQUEST "pass_discard_request"
218e99
-#define QCOW2_OPT_DISCARD_SNAPSHOT "pass_discard_snapshot"
218e99
-#define QCOW2_OPT_DISCARD_OTHER "pass_discard_other"
218e99
+#define QCOW2_OPT_LAZY_REFCOUNTS "lazy-refcounts"
218e99
+#define QCOW2_OPT_DISCARD_REQUEST "pass-discard-request"
218e99
+#define QCOW2_OPT_DISCARD_SNAPSHOT "pass-discard-snapshot"
218e99
+#define QCOW2_OPT_DISCARD_OTHER "pass-discard-other"
218e99
 
218e99
 typedef struct QCowHeader {
218e99
     uint32_t magic;
218e99
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
218e99
index 1cf8bf7..1f39c6a 100755
218e99
--- a/tests/qemu-iotests/051
218e99
+++ b/tests/qemu-iotests/051
218e99
@@ -72,11 +72,11 @@ echo
218e99
 echo === Enable and disable lazy refcounting on the command line, plus some invalid values ===
218e99
 echo
218e99
 
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy_refcounts=on
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy_refcounts=off
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy_refcounts=
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy_refcounts=42
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy_refcounts=foo
218e99
+run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=on
218e99
+run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=off
218e99
+run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=
218e99
+run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=42
218e99
+run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=foo
218e99
 
218e99
 
218e99
 echo
218e99
@@ -85,8 +85,8 @@ echo
218e99
 
218e99
 _make_test_img -ocompat=0.10 $size
218e99
 
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy_refcounts=on
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy_refcounts=off
218e99
+run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=on
218e99
+run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=off
218e99
 
218e99
 echo
218e99
 echo === No medium ===
218e99
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
218e99
index 8630382..9588d0c 100644
218e99
--- a/tests/qemu-iotests/051.out
218e99
+++ b/tests/qemu-iotests/051.out
218e99
@@ -22,35 +22,35 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: could not
218e99
 
218e99
 === Enable and disable lazy refcounting on the command line, plus some invalid values ===
218e99
 
218e99
-Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=on
218e99
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
218e99
 QEMU 1.5.50 monitor - type 'help' for more information
218e99
 (qemu) q?[K?[Dqu?[K?[D?[Dqui?[K?[D?[D?[Dquit?[K
218e99
 
218e99
-Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=off
218e99
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
218e99
 QEMU 1.5.50 monitor - type 'help' for more information
218e99
 (qemu) q?[K?[Dqu?[K?[D?[Dqui?[K?[D?[D?[Dquit?[K
218e99
 
218e99
-Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=
218e99
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=: Parameter 'lazy_refcounts' expects 'on' or 'off'
218e99
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=: could not open disk image TEST_DIR/t.qcow2: Invalid argument
218e99
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=
218e99
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=: Parameter 'lazy-refcounts' expects 'on' or 'off'
218e99
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=: could not open disk image TEST_DIR/t.qcow2: Invalid argument
218e99
 
218e99
-Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=42
218e99
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=42: Parameter 'lazy_refcounts' expects 'on' or 'off'
218e99
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=42: could not open disk image TEST_DIR/t.qcow2: Invalid argument
218e99
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42
218e99
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42: Parameter 'lazy-refcounts' expects 'on' or 'off'
218e99
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42: could not open disk image TEST_DIR/t.qcow2: Invalid argument
218e99
 
218e99
-Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=foo
218e99
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=foo: Parameter 'lazy_refcounts' expects 'on' or 'off'
218e99
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=foo: could not open disk image TEST_DIR/t.qcow2: Invalid argument
218e99
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo
218e99
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo: Parameter 'lazy-refcounts' expects 'on' or 'off'
218e99
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo: could not open disk image TEST_DIR/t.qcow2: Invalid argument
218e99
 
218e99
 
218e99
 === With version 2 images enabling lazy refcounts must fail ===
218e99
 
218e99
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 
218e99
-Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=on
218e99
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=on: Lazy refcounts require a qcow2 image with at least qemu 1.1 compatibility level
218e99
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=on: could not open disk image TEST_DIR/t.qcow2: Invalid argument
218e99
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
218e99
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on: Lazy refcounts require a qcow2 image with at least qemu 1.1 compatibility level
218e99
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on: could not open disk image TEST_DIR/t.qcow2: Invalid argument
218e99
 
218e99
-Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=off
218e99
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
218e99
 QEMU 1.5.50 monitor - type 'help' for more information
218e99
 (qemu) q?[K?[Dqu?[K?[D?[Dqui?[K?[D?[D?[Dquit?[K
218e99
 
218e99
-- 
218e99
1.7.1
218e99