[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v20 07/26] cow.c: replace QEMUOptionParameter wi
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v20 07/26] cow.c: replace QEMUOptionParameter with QemuOpts |
Date: |
Wed, 12 Feb 2014 17:19:06 -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:
> cow.c: replace QEMUOptionParameter with QemuOpts
>
> Signed-off-by: Dong Xu Wang <address@hidden>
> Signed-off-by: Chunyan Liu <address@hidden>
> ---
> block/cow.c | 46 ++++++++++++++++++++++------------------------
> 1 files changed, 22 insertions(+), 24 deletions(-)
>
> +static QemuOptsList cow_create_opts = {
> + .name = "cow-create-opts",
> + .head = QTAILQ_HEAD_INITIALIZER(cow_create_opts.head),
> + .desc = {
> + {
> + .name = BLOCK_OPT_SIZE,
> + .type = QEMU_OPT_SIZE,
> + .help = "Virtual disk size"
Oh, these QemuOpts really ARE constant strings in the general case, and
passing these strings to free() could be a disaster. I hope we're okay
in what we do; in fact, maybe it's worth a patch to QemuOptsList that
adds a bool record of whether the list is dynamically allocated (false
by default for all static initialization, and true when malloc'ing a
list) and then asserting that attempts to free (parts of) a list are
only done on a dynamically allocated list.
> @@ -414,14 +412,14 @@ static BlockDriver bdrv_cow = {
> .bdrv_probe = cow_probe,
> .bdrv_open = cow_open,
> .bdrv_close = cow_close,
> - .bdrv_create = cow_create,
> + .bdrv_create2 = cow_create,
Might as well keep alignment looking nice.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v20 05/26] remove assertion of qemu_opt_get functions, (continued)
- [Qemu-devel] [PATCH v20 01/26] add def_value_str to QemuOptDesc, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 06/26] change block layer to support both QemuOpts and QEMUOptionParameter, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 08/26] gluster.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 07/26] cow.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- Re: [Qemu-devel] [PATCH v20 07/26] cow.c: replace QEMUOptionParameter with QemuOpts,
Eric Blake <=
- [Qemu-devel] [PATCH v20 11/26] qcow2.c: replace QEMUOptionParameter with QemuOpts in create, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 09/26] iscsi.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- [Qemu-devel] [PATCH v20 10/26] qcow.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/12
- [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