[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 2/6] block: Take advantage of QemuOpt default int
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v3 2/6] block: Take advantage of QemuOpt default integers |
Date: |
Thu, 10 Jan 2019 13:18:56 -0600 |
Instead of defining an integer to a default string value (where we
have to be careful how we spelled the integer because of the use of
stringify), populate a default integer value instead.
Drop a useless stringify(0); a missing default is just as easy to
interpret as 0 as an explicit string 0.
Signed-off-by: Eric Blake <address@hidden>
---
block/parallels.c | 2 +-
block/qcow2.c | 2 +-
block/qed.c | 2 +-
block/vdi.c | 2 +-
block/vhdx.c | 3 +--
5 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index cc9445879d7..a7593310332 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -96,7 +96,7 @@ static QemuOptsList parallels_create_opts = {
.name = BLOCK_OPT_CLUSTER_SIZE,
.type = QEMU_OPT_SIZE,
.help = "Parallels image cluster size",
- .def_value_str = stringify(DEFAULT_CLUSTER_SIZE),
+ .def_value_int = DEFAULT_CLUSTER_SIZE,
},
{ /* end of list */ }
}
diff --git a/block/qcow2.c b/block/qcow2.c
index 4897abae5e8..c9b76a9ea93 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -4892,7 +4892,7 @@ static QemuOptsList qcow2_create_opts = {
.name = BLOCK_OPT_CLUSTER_SIZE,
.type = QEMU_OPT_SIZE,
.help = "qcow2 cluster size",
- .def_value_str = stringify(DEFAULT_CLUSTER_SIZE)
+ .def_value_int = DEFAULT_CLUSTER_SIZE,
},
{
.name = BLOCK_OPT_PREALLOC,
diff --git a/block/qed.c b/block/qed.c
index 9377c0b7ad8..9db36c39066 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -1651,7 +1651,7 @@ static QemuOptsList qed_create_opts = {
.name = BLOCK_OPT_CLUSTER_SIZE,
.type = QEMU_OPT_SIZE,
.help = "Cluster size (in bytes)",
- .def_value_str = stringify(QED_DEFAULT_CLUSTER_SIZE)
+ .def_value_int = QED_DEFAULT_CLUSTER_SIZE,
},
{
.name = BLOCK_OPT_TABLE_SIZE,
diff --git a/block/vdi.c b/block/vdi.c
index 2380daa583e..65659c9b179 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -985,7 +985,7 @@ static QemuOptsList vdi_create_opts = {
.name = BLOCK_OPT_CLUSTER_SIZE,
.type = QEMU_OPT_SIZE,
.help = "VDI cluster (block) size",
- .def_value_str = stringify(DEFAULT_CLUSTER_SIZE)
+ .def_value_int = DEFAULT_CLUSTER_SIZE,
},
#endif
#if defined(CONFIG_VDI_STATIC_IMAGE)
diff --git a/block/vhdx.c b/block/vhdx.c
index b785aef4b7b..54bf6805fc6 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -2085,13 +2085,12 @@ static QemuOptsList vhdx_create_opts = {
{
.name = VHDX_BLOCK_OPT_LOG_SIZE,
.type = QEMU_OPT_SIZE,
- .def_value_str = stringify(DEFAULT_LOG_SIZE),
+ .def_value_int = DEFAULT_LOG_SIZE,
.help = "Log size; min 1MB."
},
{
.name = VHDX_BLOCK_OPT_BLOCK_SIZE,
.type = QEMU_OPT_SIZE,
- .def_value_str = stringify(0),
.help = "Block Size; min 1MB, max 256MB. " \
"0 means auto-calculate based on image size."
},
--
2.20.1
- [Qemu-devel] [PATCH v3 0/6] include: Auto-generate the sizes lookup table, Eric Blake, 2019/01/10
- [Qemu-devel] [PATCH v3 3/6] Revert "vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE", Eric Blake, 2019/01/10
- [Qemu-devel] [PATCH v3 2/6] block: Take advantage of QemuOpt default integers,
Eric Blake <=
- [Qemu-devel] [PATCH v3 4/6] qemu: Prefer '(x * MiB)' over 'S_xiB', Eric Blake, 2019/01/10
- [Qemu-devel] [PATCH v3 5/6] Revert "include: Add a comment to explain the origin of sizes' lookup table", Eric Blake, 2019/01/10
- [Qemu-devel] [PATCH v3 6/6] Revert "include: Add a lookup table of sizes", Eric Blake, 2019/01/10
- Re: [Qemu-devel] [Qemu-block] [PATCH v3 0/6] include: Auto-generate the sizes lookup table, Eric Blake, 2019/01/10
- Re: [Qemu-devel] [PATCH v3 0/6] include: Auto-generate the sizes lookup table, Kevin Wolf, 2019/01/11
- Re: [Qemu-devel] [PATCH v3 0/6] include: Auto-generate the sizes lookup table, no-reply, 2019/01/14