[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 5/5] qapi: More complex uses of QAPI_LIST_APPEND
From: |
Eric Blake |
Subject: |
Re: [PATCH v4 5/5] qapi: More complex uses of QAPI_LIST_APPEND |
Date: |
Fri, 5 Feb 2021 11:13:59 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 1/26/21 3:31 AM, Markus Armbruster wrote:
> Eric Blake <eblake@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@redhat.com>
>> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v4 5/5] qapi: More complex uses of QAPI_LIST_APPEND,
Eric Blake <=