Eric Blake <ebl...@redhat.com> writes: > On 03/23/2017 02:18 PM, Eric Blake wrote: > >>>>> - if (port) { >>>>> - /* check for ipv6 */ >>>>> - if (strchr(host, ':')) { >>>>> - strbuf = g_strdup_printf("[%s]:%s", host, port); >>>>> - } else { >>>>> - strbuf = g_strdup_printf("%s:%s", host, port); >>>> >>>> The old code only prints port information if it is present... >>>> > >>>> ...but the new code unconditionally prints port information, even when >>>> port == NULL. Oops. >>> >>> How can port be null? SocketAddress member port is mandatory... >> >> Indeed. Does that mean the old code had a dead branch? Looks like it! > > Or else my reading of the old code was wrong. It looks like port was > optional on the command line, but in the conversion to QemuOpts, a > missing port was treated as the default port. Now that you are not > going through QemuOpts, you have to make sure that you can still supply > a default port to keep the QAPI happy with a mandatory port.
Who is "you", and what exactly does "you" have to do? ;)