qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V26 13/32] vvfat.c: handle cross_driver's create


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH V26 13/32] vvfat.c: handle cross_driver's create_options and create_opts
Date: Thu, 01 May 2014 13:22:54 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 05/01/2014 01:18 PM, Eric Blake wrote:
> On 04/29/2014 03:10 AM, Chunyan Liu wrote:
>> vvfat shares create options of qcow driver. To avoid vvfat broken when
> 
> s/broken/breaking/
> 
>> qcow driver changes from QEMUOptionParameter to QemuOpts, let it able
>> to handle both cases.
>>

>> +    if (bdrv_qcow->create_options) {
>> +        create_opts = params_to_opts(bdrv_qcow->create_options);
> 
> allocated...
> 
>> +    } else {
>> +        create_opts = bdrv_qcow->create_opts;
> 
> vs. reference...
> 

Couldn't you just do:

create_opts = qemu_opts_append(NULL, bdrv_qcow2->create_opts,
                               bdrv_qcow2->create_options);

at which point, your blind free on cleanup will just work?

>>  err:
>> +    qemu_opts_del(opts);
>> +    qemu_opts_free(create_opts);
> 
> but unconditionally freed on either path.  Calling
> g_free(bdrv_qcow->create_opts) is not nice.
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]