From: Max Reitz <mreitz@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] qapi: Allow blockdev-add for NBD
Date: Wed, 3 Feb 2016 18:16:34 +0100 [thread overview]
Message-ID: <56B235F2.1050005@redhat.com> (raw)
In-Reply-To: <20160203170609.GR30222@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2190 bytes --]
On 03.02.2016 18:06, Daniel P. Berrange wrote:
> On Wed, Feb 03, 2016 at 05:33:16PM +0100, Max Reitz wrote:
>> We have to introduce a new object (BlockdevOptionsNbd) for several
>> reasons:
>> - Neither of InetSocketAddress nor UnixSocketAddress alone is
>> sufficient, because both are supported
>> - We cannot use SocketAddress because NBD does not support an fd,
>> and because it is not a flat union which BlockdevOptionsNbd is
>
> With my patch series that converts NBD to use QIOChannel, all the
> entry points for client & server *do* take a SocketAddress struct
> to provide address info. So internally the code does in fact allow
> use of an FD, if there were a way to specify it a the QAPI level...
>
> eg see
>
> https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg04159.html
>
>> - We cannot use a flat union of InetSocketAddress and
>> UnixSocketAddress because we would need some kind of discriminator
>> which we do not have; we could inline the UnixSocketAddress as a
>> string and then make it an 'alternate' type instead of a union, but
>> this will not work either, because:
>> - InetSocketAddress itself is not suitable for NBD because the port is
>> not optional (which it is for NBD) and because it offers more options
>> (like choosing between ipv4 and ipv6) which NBD does not support.
>
> The *should* support ipv4 and ipv6 options for NBD. We should also make
> the port optional in the SocketAddress struct - I tried to do that previously
> but my patch was flawed, but we should revisit this.
>
> So IMHO all the things you list above are reasons *for* using SocketAddress
> and not re-inventing it poorly with explicit host + port fields.
That's good news, thanks!
However, the issue remains that the NBD block driver expects flattened
options which is syntactically incompatible to SocketAddress. Maybe the
best way to address this would be to just make block/nbd.c directly
accept a SocketAddress and keep the old flattened @host, @port, and
@path options only as a legacy mapping to inet.host, inet.port, and
unix.path.
Anyway, I'll wait for your series to get merged, then.
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-02-03 17:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-03 16:33 [Qemu-devel] [PATCH 0/2] qapi: Allow blockdev-add for NBD Max Reitz
2016-02-03 16:33 ` [Qemu-devel] [PATCH 1/2] block/nbd: Reject port parameter without host Max Reitz
2016-02-03 16:38 ` Eric Blake
2016-02-03 16:39 ` Max Reitz
2016-02-03 16:33 ` [Qemu-devel] [PATCH 2/2] qapi: Allow blockdev-add for NBD Max Reitz
2016-02-03 16:48 ` Eric Blake
2016-02-03 17:00 ` Max Reitz
2016-02-04 11:58 ` Paolo Bonzini
2016-02-03 17:06 ` Daniel P. Berrange
2016-02-03 17:16 ` Max Reitz [this message]
2016-02-04 12:01 ` Paolo Bonzini
2016-02-04 13:08 ` Kevin Wolf
2016-02-04 13:19 ` Daniel P. Berrange
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=56B235F2.1050005@redhat.com \
--to=mreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.