[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v20 17/26] rbd.c: replace QEMUOptionParameter wi
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v20 17/26] rbd.c: replace QEMUOptionParameter with QemuOpts |
Date: |
Mon, 17 Feb 2014 11:57:31 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 02/11/2014 11:33 PM, Chunyan Liu wrote:
> rbd.c: replace QEMUOptionParameter with QemuOpts
>
> Signed-off-by: Dong Xu Wang <address@hidden>
> Signed-off-by: Chunyan Liu <address@hidden>
> ---
> block/rbd.c | 63
> +++++++++++++++++++++++++++++------------------------------
> 1 files changed, 31 insertions(+), 32 deletions(-)
>
> + objsize = qemu_opt_get_size_del(opts, BLOCK_OPT_CLUSTER_SIZE, 0);
> + if (objsize) {
> + if ((objsize - 1) & objsize) { /* not a power of 2? */
> + error_report("obj size needs to be power of 2");
> + return -EINVAL;
> + }
> + if (objsize < 4096) {
> + error_report("obj size too small");
> + return -EINVAL;
> }
> + {
> + .name = BLOCK_OPT_CLUSTER_SIZE,
> + .type = QEMU_OPT_SIZE,
> + .help = "RBD object size",
> + .def_value_str = stringify(0),
Do we really want to list a default of 0, given that the code behaves
the same as if 0 had been specified or if the argument had been omitted?
Passing 0 doesn't really mean using a cluster size of 0, which makes
listing it as an explicit default would look odd.
> - .create_options = qemu_rbd_create_options,
> + .create_opts = qemu_rbd_create_opts,
Hmm, I've noticed that your series is inconsistent on whether it uses '=
foo_opts' or '= &foo_opts' in these initializers (for example, 15/26
used & even though nothing else did, 16/26 uses & but all other
initializers were also using &, and in this 17/26 nothing is using &).
Not that it matters to the compiler, but there's a lot to be said for
consistency.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v20 12/26] qcow2.c: replace QEMUOptionParameter with QemuOpts in amend options, (continued)
- [Qemu-devel] [PATCH v20 12/26] qcow2.c: replace QEMUOptionParameter with QemuOpts in amend options, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 15/26] raw-win32.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 13/26] qed.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 14/26] raw-posix.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 17/26] rbd.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- Re: [Qemu-devel] [PATCH v20 17/26] rbd.c: replace QEMUOptionParameter with QemuOpts,
Eric Blake <=
- [Qemu-devel] [PATCH v20 16/26] raw_bsd.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 19/26] ssh.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 21/26] vmdk.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 22/26] vpc.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 18/26] sheepdog.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12