[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.9 3/5] rbd: Rewrite the code to extract li
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH for-2.9 3/5] rbd: Rewrite the code to extract list-valued options |
Date: |
Fri, 24 Mar 2017 07:36:14 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Eric Blake <address@hidden> 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? ;)
- Re: [Qemu-devel] [PATCH for-2.9 1/5] rbd: Clean up runtime_opts, (continued)
Re: [Qemu-devel] [PATCH for-2.9 3/5] rbd: Rewrite the code to extract list-valued options, Kevin Wolf, 2017/03/23