On 1/26/21 3:31 AM, Markus Armbruster wrote: > Eric Blake <ebl...@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 <ebl...@redhat.com> >> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@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