From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Het Gala <het.gala@nutanix.com>
Cc: Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org, prerna.saxena@nutanix.com,
quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com,
eblake@redhat.com, manish.mishra@nutanix.com,
aravind.retnakaran@nutanix.com
Subject: Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol.
Date: Tue, 30 May 2023 11:34:22 +0100 [thread overview]
Message-ID: <ZHXRLlL67vK8w32B@redhat.com> (raw)
In-Reply-To: <fde7d182-0744-d907-5c1d-3f60f9a5d19c@nutanix.com>
On Tue, May 30, 2023 at 02:26:23PM +0530, Het Gala wrote:
>
> On 30/05/23 1:26 pm, Markus Armbruster wrote:
> > Het Gala <het.gala@nutanix.com> writes:
> >
> > > On 30/05/23 12:28 pm, Markus Armbruster wrote:
> > > > Het Gala<het.gala@nutanix.com> writes:
> > > >
> > > > > On 25/05/23 11:04 pm, Markus Armbruster wrote:
> > [...]
> >
> > > > > > Aside: a more powerful type system would let us extend SocketAddress
> > > > > > with additional variants instead of wrapping it in a union.
> > > > > Markus, what do you mean by additional variants here in context of socket? Can you give a small example.
> > > > As is, we have a nest of two unions:
> > > >
> > > > * The outer union has branches @socket, @exec, @rdma.
> > > >
> > > > * Branch @socket is the inner union, it has branches @inet, @unix, ...
> > > >
> > > > A more powerful type system would let us extend SocketAddress instead,
> > > > so MigrateAddress has everything SocketAddress has, plus additional
> > > > branches @exec, @rdma. Naturally, the type of the discriminator also
> > > > needs to be extended, so that it has everything SocketAddress's
> > > > discriminator type has, plus additional members @exec, @rdma.
> > > Okay, so you mean something like :
> > >
> > > +# Since 8.1
> > > +##
> > > +{ 'union': 'MigrateAddress',
> > > + 'base': { 'transport' : 'MigrateTransport'},
> > > + 'discriminator': 'transport',
> > > + 'data': {
> > > + 'inet': 'InetSocketAddress',
> > > + 'unix': 'UnixSocketAddress',
> > > + 'vsock': 'VsockSocketAddress',
> > > + 'fd': 'str',
> > > + 'exec': 'MigrateExecCommand',
> > > + 'rdma': 'InetSocketAddress' } }
> > >
> > > Even I agree that directly leveraging this is the best option, but then wouldn't it introduce redundancy ? we would not be able to leverage socket union right in that case or am I missing something.
> > Yes, there's redundancy, due to QAPI's insufficient expressive power.
> >
> > Is the cleaner external interface worth the (internal) redundancy, and
> > possibly coding complications that go with it?
>
> Honestly, I would like to have it this way, where the user is aware of all
> the transport mechanisms available. But I guess for external interface
> problem statement, the migration code flow has similar path for
> SocketAddress and non-socketAddress (exec and rdma). So even if on the QAPI
> side we express explicitly all the transport mechanisms, while implementing
> it we either would need to brinf them under a single umbrella. For now, I
> would keep the implementation as it is (union inside a union) but would want
> to have a more powerful and better appraoch out there if possible.
IMHO, unpacking the SocketAddress types into the two level is not something
we need to do. The main (perhaps even only) reason it arises as a design
question is because historically the migration public interface has NOT
used SocketAddress, and exposed unix/inet/vsock as distinct top level
options, and this taints our thoughts.
If the "migrate" command didn't already exist and we were adding it now
IMHO we would just expose 'socket': 'SocketAdress' as a top level type,
in parallel with 'exec' and 'rdma', and not even discuss the idea of
unpacking 'SocketAddress'.
IMHO the compelling reason to NOT unpack 'SocketAddress' is that it lets
the migration code seemlessly benefit from any new 'SocketAddress' types
that gets implemented. eg consider when 'vsock' was added to QEMU. Any
command that took a 'SocketAddress' parameter needed no QAPI changes
and usually no code changes either.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2023-05-30 10:35 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-19 9:46 [PATCH v5 0/9] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration Het Gala
2023-05-19 9:46 ` [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol Het Gala
2023-05-25 17:34 ` Markus Armbruster
2023-05-29 9:37 ` Het Gala
2023-05-30 6:58 ` Markus Armbruster
2023-05-30 7:32 ` Het Gala
2023-05-30 7:56 ` Markus Armbruster
2023-05-30 8:56 ` Het Gala
2023-05-30 10:34 ` Daniel P. Berrangé [this message]
2023-05-30 8:57 ` Daniel P. Berrangé
2023-05-30 9:02 ` Het Gala
2023-05-30 11:38 ` Het Gala
2023-05-30 12:10 ` Daniel P. Berrangé
2023-06-01 8:56 ` Het Gala
2023-05-19 9:46 ` [PATCH v5 2/9] migration: convert uri parameter into 'MigrateAddress' struct Het Gala
2023-05-19 9:46 ` [PATCH v5 3/9] migration: convert socket backend to accept MigrateAddress struct Het Gala
2023-05-19 9:46 ` [PATCH v5 4/9] migration: convert rdma " Het Gala
2023-05-19 9:46 ` [PATCH v5 5/9] migration: convert exec " Het Gala
2023-05-19 9:52 ` Het Gala
2023-05-19 9:46 ` [PATCH v5 6/9] migration: modified migration QAPIs to accept 'channels' argument for migration Het Gala
2023-05-25 17:50 ` Markus Armbruster
2023-05-29 11:33 ` Het Gala
2023-05-30 7:13 ` Markus Armbruster
2023-05-30 8:45 ` Het Gala
2023-05-30 9:17 ` Markus Armbruster
2023-05-19 9:46 ` [PATCH v5 7/9] migration: modify migration_channels_and_uri_compatible() to incorporate newer migration QAPI syntax Het Gala
2023-05-19 9:46 ` [PATCH v5 8/9] migration: Introduced MigrateChannelList struct to migration code flow Het Gala
2023-05-25 18:02 ` Markus Armbruster
2023-05-29 11:35 ` Het Gala
2023-05-19 9:46 ` [PATCH v5 9/9] migration: adding test case for modified QAPI syntax Het Gala
2023-05-19 9:49 ` Het Gala
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=ZHXRLlL67vK8w32B@redhat.com \
--to=berrange@redhat.com \
--cc=aravind.retnakaran@nutanix.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=het.gala@nutanix.com \
--cc=manish.mishra@nutanix.com \
--cc=pbonzini@redhat.com \
--cc=prerna.saxena@nutanix.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.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).