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
signature.asc
Description: OpenPGP digital signature