From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"berrange@redhat.com" <berrange@redhat.com>,
Denis Lunev <den@virtuozzo.com>,
"kraxel@redhat.com" <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3] qapi: Add InetSocketAddress member keep-alive
Date: Wed, 24 Jul 2019 14:09:15 +0000 [thread overview]
Message-ID: <6a1109d2-4afd-a68f-27eb-200724bb9f47@virtuozzo.com> (raw)
In-Reply-To: <548af442-ed15-3065-ddbd-a3728a4e752c@redhat.com>
19.07.2019 23:29, Eric Blake wrote:
> On 6/25/19 8:32 AM, Markus Armbruster wrote:
>> I apologize for dragging my feet on this review.
>>
>> Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:
>>
>>> It's needed to provide keepalive for nbd client to track server
>>> availability.
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>> ---
>>>
>
>>> +++ b/qapi/sockets.json
>>> @@ -53,6 +53,9 @@
>>> #
>>> # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
>>> #
>>> +# @keep-alive: enable keep-alive when connecting to this socket. Not supported
>>> +# for server-side connections. (Since 4.1)
>
> It looks like this missed 4.1. Are you planning on sending v4, to address
>
>>> +#
>>
>> Is "server-side connection" is an established term?
>>
>> For what it's worth, "passive socket" is, see listen(2).
>>
>>> # Since: 1.3
>>> ##
>>> { 'struct': 'InetSocketAddress',
>>> @@ -61,7 +64,8 @@
>>> '*numeric': 'bool',
>>> '*to': 'uint16',
>>> '*ipv4': 'bool',
>>> - '*ipv6': 'bool' } }
>>> + '*ipv6': 'bool',
>>> + '*keep-alive': 'bool' } }
>>>
>>> ##
>>> # @UnixSocketAddress:
>>> diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
>>> index 8850a280a8..813063761b 100644
>>> --- a/util/qemu-sockets.c
>>> +++ b/util/qemu-sockets.c
>>> @@ -438,6 +438,12 @@ int inet_connect_saddr(InetSocketAddress *saddr, Error **errp)
>>> struct addrinfo *res, *e;
>>> int sock = -1;
>>>
>>> + if (saddr->keep_alive) {
>>> + error_setg(errp, "keep-alive options is not supported for server-side "
>>> + "connection");
>>> + return -1;
>>> + }
>>> +
>>> res = inet_parse_connect_saddr(saddr, errp);
>>> if (!res) {
>>> return -1;
>>
>> I'm afraid you added this to the wrong function; ...
>>
>>> @@ -457,6 +463,19 @@ int inet_connect_saddr(InetSocketAddress *saddr, Error **errp)
>>> }
>>>
>>> freeaddrinfo(res);
>>> +
>>> + if (saddr->keep_alive) {
>>
>> ... it renders this code unreachable.
>>
>> I guess the "not supported for passive sockets" check should go into
>> inet_listen_saddr() instead.
>
> this comment?
>
Sorry for big delay, will resend for 4.2 soon.
--
Best regards,
Vladimir
prev parent reply other threads:[~2019-07-24 14:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 17:31 [Qemu-devel] [PATCH v3] qapi: Add InetSocketAddress member keep-alive Vladimir Sementsov-Ogievskiy
2019-06-25 13:32 ` Markus Armbruster
2019-07-19 20:29 ` Eric Blake
2019-07-24 14:09 ` Vladimir Sementsov-Ogievskiy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a1109d2-4afd-a68f-27eb-200724bb9f47@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=den@virtuozzo.com \
--cc=eblake@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).