[libvirt] [PATCH 2/2] libxl: use init and dispose functions with libxl_physinfo

Jim Fehlig jfehlig at suse.com
Wed Feb 8 18:43:38 UTC 2017


Joao Martins wrote:
> On 02/08/2017 04:17 PM, Jim Fehlig wrote:
>> Joao Martins wrote:
>>> On 02/02/2017 10:39 PM, Jim Fehlig wrote:
>>>> The typical pattern when calling libxl functions that populate a
>>>> structure is
>>>>
>>>>   libxl_foo foo;
>>>>   libxl_foo_init(&foo);
>>>>   libxl_get_foo(ctx, &foo);
>>>>   ...
>>>>   libxl_foo_dispose(&foo);
>>>>
>>>> Fix several instances of libxl_physinfo missing the init and
>>>> dispose calls.
>>> Indeed,
>>>
>>>> Signed-off-by: Jim Fehlig <jfehlig at suse.com>
>>> Reviewed-by: Joao Martins <joao.m.martins at oracle.com>
>>>
>>> See also one comment/nit below, perhaps one libxl_physinfo_init could be moved
>>> slightly up..
>>>
>>>> [...]
>>>> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
>>>> index 3a69720..8951bef 100644
>>>> --- a/src/libxl/libxl_driver.c
>>>> +++ b/src/libxl/libxl_driver.c
>>>> @@ -4286,6 +4286,7 @@ libxlNodeGetFreeMemory(virConnectPtr conn)
>>>>      if (virNodeGetFreeMemoryEnsureACL(conn) < 0)
>>>>          goto cleanup;
>>>>  
>>>> +    libxl_physinfo_init(&phy_info);
>>> .. namely here? That is before virNodeGetFreeMemoryEnsureACL.
>> Nice catch. Moved as suggested in my local branch.
>>
>> Any other comments on this small series? Would be nice to get these bug fixes
>> committed :-).
>>
> Nope, looks all good to me:
> 
> Acked-by: Joao Martins <joao.m.martins at oracle.com>

Thanks, I've pushed these fixes now.

Regards,
Jim




More information about the libvir-list mailing list