[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for mi
|
From: |
Markus Armbruster |
|
Subject: |
Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol. |
|
Date: |
Tue, 30 May 2023 09:56:05 +0200 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
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?
- [PATCH v5 0/9] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration, Het Gala, 2023/05/19
- [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Het Gala, 2023/05/19
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Markus Armbruster, 2023/05/25
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Het Gala, 2023/05/29
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Markus Armbruster, 2023/05/30
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Het Gala, 2023/05/30
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol.,
Markus Armbruster <=
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Het Gala, 2023/05/30
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Daniel P . Berrangé, 2023/05/30
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Daniel P . Berrangé, 2023/05/30
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Het Gala, 2023/05/30
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Het Gala, 2023/05/30
- Re: [PATCH v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol., Daniel P . Berrangé, 2023/05/30
[PATCH v5 4/9] migration: convert rdma backend to accept MigrateAddress struct, Het Gala, 2023/05/19
[PATCH v5 3/9] migration: convert socket backend to accept MigrateAddress struct, Het Gala, 2023/05/19
[PATCH v5 5/9] migration: convert exec backend to accept MigrateAddress struct., Het Gala, 2023/05/19