From: Eric Blake <eblake@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@virtuozzo.com>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
Denis Lunev <den@virtuozzo.com>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
Markus Armbruster <armbru@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] nbd-client: enable TCP keepalive
Date: Wed, 5 Jun 2019 14:48:45 -0500 [thread overview]
Message-ID: <d8d3da39-d136-a7b1-5ad4-ad3742f8ffa1@redhat.com> (raw)
In-Reply-To: <20190605173601.GB13261@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3006 bytes --]
On 6/5/19 12:36 PM, Daniel P. Berrangé wrote:
>>
>> Ok.
>>
>> One more thing to discuss then. Should I add keepalive directly to BlockdevOptionsNbd?
>>
>> Seems more useful to put it into SocketAddress, to be reused by other socket users..
>> But "SocketAddress" sounds like address, not like address+connection-options. On
>> the other hand, structure names are not part of API. So, finally, is InetSocketAddress
>> a good place for such thing?
>
> That's an interesting idea. Using InetSocketAddress would mean that we could
> get support for this enabled "for free" everywhere in QEMU that uses an
> InetSocketAddress as its master config format.
I like the idea as well.
>
> Of course there's plenty of places not using InetSocketAddress that would
> still require some glue to wire up the code which converts the custom
> format into InetSocketAddress
Hmm - how many places are we using InetSocketAddress (which allows an
optional 'to' port value) when we really meant InetSocketAddressBase?
There may be some interesting hierarchy decisions to consider on where
we stick a keepalive option.
This also made me wonder if we should start a deprecation clock to
improve the nbd-server-start command to use SocketAddress instead of
SocketAddressLegacy. If we revive Max's work on implementing a default
branch for a union discriminator
(https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg01682.html),
we could have something like:
{ 'enum': 'NbdSocketAddressHack',
'data': [ 'legacy', 'inet', 'unix' ] }
{ 'struct': 'NbdServerAddrLegacy',
'data': { 'addr', 'SocketAddressLegacy' } }
{ 'union': 'NbdServerAddr',
'base': { 'type': 'NbdSocketAddressHack',
'*tls-creds': 'str',
'*tls-authz': 'str' },
'discriminator': 'type',
'default-variant': 'legacy',
'data': { 'legacy': 'NbdServerAddrLegacy',
'inet', 'InetSocketAddress',
'unix', 'UnixSocketAddress' } }
{ 'command', 'nbd-server-start', 'data': 'NbdServerAddr' }
which should be backwards compatible with the existing:
{ "execute": "nbd-server-start", "arguments": {
"tls-authz": "authz0",
"addr": { "type": "inet", "data": {
"host": "localhost", "port": "10809" } } } }
by relying on the discriminator's default expansion to:
{ "execute": "nbd-server-start", "arguments": {
"tls-authz": "authz0",
"type": "legacy",
"addr": { "type": "inet", "data": {
"host": "localhost", "port": "10809" } } } }
but also permit the flatter:
{ "execute": "nbd-server-start", "arguments": {
"tls-authz": "authz0",
"type": "inet", "host": "localhost", "port": "10809" } }
and let us start a deprecation clock to get rid of the "legacy" branch
(especially if coupled with Kevin's work on adding introspectable
deprecation annotations in QAPI).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-06-05 19:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-05 10:09 [Qemu-devel] [PATCH 0/2] nbd: enable keepalive Vladimir Sementsov-Ogievskiy
2019-06-05 10:09 ` [Qemu-devel] [PATCH 1/2] io/channel: add qio_channel_set_keepalive Vladimir Sementsov-Ogievskiy
2019-06-05 14:38 ` Eric Blake
2019-06-05 16:07 ` Daniel P. Berrangé
2019-06-05 16:02 ` Daniel P. Berrangé
2019-06-05 16:10 ` Vladimir Sementsov-Ogievskiy
2019-06-05 10:09 ` [Qemu-devel] [PATCH 2/2] nbd-client: enable TCP keepalive Vladimir Sementsov-Ogievskiy
2019-06-05 14:39 ` Eric Blake
2019-06-05 14:43 ` Denis V. Lunev
2019-06-05 16:37 ` Daniel P. Berrangé
2019-06-05 17:05 ` Vladimir Sementsov-Ogievskiy
2019-06-05 17:12 ` Eric Blake
2019-06-05 17:28 ` Vladimir Sementsov-Ogievskiy
2019-06-05 17:36 ` Daniel P. Berrangé
2019-06-05 19:48 ` Eric Blake [this message]
2019-06-05 20:11 ` [Qemu-devel] nbd-server-add [was: [PATCH 2/2] nbd-client: enable TCP keepalive] Eric Blake
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=d8d3da39-d136-a7b1-5ad4-ad3742f8ffa1@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=den@virtuozzo.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/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).