[libvirt] [PATCH 3/6] qemu_driver: use VIR_AUTOUNREF() with virQEMUDriverConfigPtr 3/3

Daniel Henrique Barboza danielhb413 at gmail.com
Thu Sep 26 16:15:16 UTC 2019



On 9/26/19 6:18 AM, Erik Skultety wrote:
> On Wed, Sep 18, 2019 at 11:56:55AM -0300, Daniel Henrique Barboza wrote:
>> virQEMUDriverConfigPtr can be auto-unref for the great majority
>> of the uses made in qemu_driver, sparing us a virObjectUnref()
>> call and sometimes a whole 'cleanup' label.
>>
>> This patch changes virQEMUDriverConfigPtr declarations to
>> use VIR_AUTOUNREF(). 'cleanup' labels were deleted when
>> applicable.
>>
>> This is the last part of this change. All but one* instance of
>> virQEMUDriverConfigPtr were changed to use VIR_AUTOUNREF().
>> 'cleanup' labels were deleted when applicable.
>>
>> * qemuStateInitialize: we can't auto-unref the pointer since we're
>> initializing the qemu_driver object with it.
>>
>> Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
>> ---
> I know you focused on virQEMUDriverConfigPtr primarily, but since you're
> following up with VIR_AUTOFREE and touching qemu_driver only, I'd like to do a
> better job and use VIR_AUTOUNREF at many more places across the file for:
>
> virCapsPtr caps
> virConnectPtr conn
> qemuDomainSaveCookiePtr cookie
> virQEMUCapsPtr qemuCaps
> qemuBlockJobDataPtr job
> virDomainCapsPtr domCaps
> virNetworkPtr network

No problem. Should I squash the first 3 patches of this series into a single
one that will touch only virQEMUDriverConfigPtr and then make one patch
for each pointer type that's changed?


Thanks,


DHB



>
> (there may be a few more...)
>
> Erik




More information about the libvir-list mailing list