[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 2/6] block: Take advantage of QemuOpt default
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v3 2/6] block: Take advantage of QemuOpt default integers |
Date: |
Fri, 11 Jan 2019 11:38:58 +0100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
Am 10.01.2019 um 20:18 hat Eric Blake geschrieben:
> 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>
> 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."
> },
Before the patch:
$ ./qemu-img create -f vhdx /tmp/test.vhdx 64M
Formatting '/tmp/test.vhdx', fmt=vhdx size=67108864 log_size=1048576
block_size=0
After the patch:
$ ./qemu-img create -f vhdx /tmp/test.vhdx 64M
Formatting '/tmp/test.vhdx', fmt=vhdx size=67108864 log_size=1048576
Intentional?
Kevin
- [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, 2019/01/10
- Re: [Qemu-devel] [PATCH v3 2/6] block: Take advantage of QemuOpt default integers,
Kevin Wolf <=
- [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