[GEDI] [PATCH v4 5/5] qapi: More complex uses of QAPI_LIST_APPEND

Eric Blake eblake at redhat.com
Fri Feb 5 17:13:59 UTC 2021


On 1/26/21 3:31 AM, Markus Armbruster wrote:
> Eric Blake <eblake at redhat.com> writes:
> 
>> These cases require a bit more thought to review; in each case, the
>> code was appending to a list, but not with a FOOList **tail variable.
>>
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov at virtuozzo.com>
>>
>> ---
>> fix qmp_guest_network_get_interfaces [Vladimir]
> 
> Fails tests/test-qga.  I should've double-checked earlier.

And me, too.  Looks like the culprit is:

>>
>> -        address_list = &info->value->ip_addresses;
>> -
>> -        while (*address_list && (*address_list)->next) {
>> -            address_list = &(*address_list)->next;
>> -        }
>> -
>> -        if (!*address_list) {
>> -            *address_list = address_item;
>> -        } else {
>> -            (*address_list)->next = address_item;
>> +        address_tail = &info->ip_addresses;
>> +        while (!*address_tail) {
>> +            address_tail = &(*address_tail)->next;
>>          }
>> +        QAPI_LIST_APPEND(address_tail, address_item);

right here; the condition 'while (!*address_tail)' should instead be
'while (*address_tail)'.  Will submit v5 now that I've identified the bug.

> I'd like to drop just this part, and merge the rest.  You can then
> respin just this part as a follow-up patch.  Okay?
> 
> I can't test qemu-ga under Windows.  Fingers crossed...
> 
> [...]
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



More information about the integration mailing list