From eblake at redhat.com Fri Feb 5 17:13:59 2021 From: eblake at redhat.com (Eric Blake) Date: Fri, 5 Feb 2021 11:13:59 -0600 Subject: [GEDI] [PATCH v4 5/5] qapi: More complex uses of QAPI_LIST_APPEND In-Reply-To: <87mtww59jp.fsf@dusky.pond.sub.org> References: <20210113221013.390592-1-eblake@redhat.com> <20210113221013.390592-6-eblake@redhat.com> <87mtww59jp.fsf@dusky.pond.sub.org> Message-ID: On 1/26/21 3:31 AM, Markus Armbruster wrote: > Eric Blake 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 >> Reviewed-by: Vladimir Sementsov-Ogievskiy >> >> --- >> 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