* [PATCH v6 0/2] check magic value for deciding the mapping of channels
@ 2022-12-20 18:36 manish.mishra
2023-01-31 14:59 ` manish.mishra
0 siblings, 1 reply; 7+ messages in thread
From: manish.mishra @ 2022-12-20 18:36 UTC (permalink / raw)
To: qemu-devel; +Cc: quintela, dgilbert, lsoaresp, manish.mishra
Current logic assumes that channel connections on the destination side are
always established in the same order as the source and the first one will
always be the main channel followed by the multifid or post-copy
preemption channel. This may not be always true, as even if a channel has a
connection established on the source side it can be in the pending state on
the destination side and a newer connection can be established first.
Basically causing out of order mapping of channels on the destination side.
Currently, all channels except post-copy preempt send a magic number, this
patch uses that magic number to decide the type of channel. This logic is
applicable only for precopy(multifd) live migration, as mentioned, the
post-copy preempt channel does not send any magic number. Also, tls live
migrations already does tls handshake before creating other channels, so
this issue is not possible with tls, hence this logic is avoided for tls
live migrations. This patch uses MSG_PEEK to check the magic number of
channels so that current data/control stream management remains
un-effected.
v2:
TLS does not support MSG_PEEK, so V1 was broken for tls live
migrations. For tls live migration, while initializing main channel
tls handshake is done before we can create other channels, so this
issue is not possible for tls live migrations. In V2 added a check
to avoid checking magic number for tls live migration and fallback
to older method to decide mapping of channels on destination side.
v3:
1. Split change in two patches, io patch for read_peek routines,
migration patch for migration related changes.
2. Add flags to io_readv calls to get extra read flags like
MSG_PEEK.
3. Some other minor fixes.
v4:
1. Removed common *all_eof routines for read peek and added one
specific to live migration.
2. Updated to use qemu_co_sleep_ns instead of qio_channel_yield.
3. Some other minor fixes.
v5:
1. Handle busy-wait in migration_channel_read_peek due partial reads.
v6:
With earlier patch, multifd_load_setup was done only in
migration_incoming_setup but if multifd channel is received before
default channel, multifd channels will be uninitialized. Moved
multifd_load_setup to migration_ioc_process_incoming.
manish.mishra (2):
io: Add support for MSG_PEEK for socket channel
migration: check magic value for deciding the mapping of channels
chardev/char-socket.c | 4 +--
include/io/channel.h | 6 ++++
io/channel-buffer.c | 1 +
io/channel-command.c | 1 +
io/channel-file.c | 1 +
io/channel-null.c | 1 +
io/channel-socket.c | 17 ++++++++-
io/channel-tls.c | 1 +
io/channel-websock.c | 1 +
io/channel.c | 16 ++++++---
migration/channel-block.c | 1 +
migration/channel.c | 45 ++++++++++++++++++++++++
migration/channel.h | 5 +++
migration/migration.c | 54 ++++++++++++++++++++---------
migration/multifd.c | 19 +++++-----
migration/multifd.h | 2 +-
migration/postcopy-ram.c | 5 +--
migration/postcopy-ram.h | 2 +-
scsi/qemu-pr-helper.c | 2 +-
tests/qtest/tpm-emu.c | 2 +-
tests/unit/test-io-channel-socket.c | 1 +
util/vhost-user-server.c | 2 +-
22 files changed, 148 insertions(+), 41 deletions(-)
--
2.22.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v6 0/2] check magic value for deciding the mapping of channels
2022-12-20 18:36 [PATCH v6 0/2] check magic value for deciding the mapping of channels manish.mishra
@ 2023-01-31 14:59 ` manish.mishra
2023-01-31 15:17 ` Peter Xu
0 siblings, 1 reply; 7+ messages in thread
From: manish.mishra @ 2023-01-31 14:59 UTC (permalink / raw)
To: qemu-devel; +Cc: quintela, dgilbert, lsoaresp, Peter Xu, Daniel P . Berrange
[-- Attachment #1: Type: text/plain, Size: 4052 bytes --]
Hi Peter, Daniel,
Just a gentle reminder on this patch if it can be merged, and really sorry i see now earlier reminders i sent were on v6[0/2] and somehow you were not CCed on that earlier. You were CCed just on v6[1/2] and v6[2,2] so that's why probably missed it.
Thanks
Manish Mishra
On 21/12/22 12:06 am, manish.mishra wrote:
> Current logic assumes that channel connections on the destination side are
> always established in the same order as the source and the first one will
> always be the main channel followed by the multifid or post-copy
> preemption channel. This may not be always true, as even if a channel has a
> connection established on the source side it can be in the pending state on
> the destination side and a newer connection can be established first.
> Basically causing out of order mapping of channels on the destination side.
> Currently, all channels except post-copy preempt send a magic number, this
> patch uses that magic number to decide the type of channel. This logic is
> applicable only for precopy(multifd) live migration, as mentioned, the
> post-copy preempt channel does not send any magic number. Also, tls live
> migrations already does tls handshake before creating other channels, so
> this issue is not possible with tls, hence this logic is avoided for tls
> live migrations. This patch uses MSG_PEEK to check the magic number of
> channels so that current data/control stream management remains
> un-effected.
>
> v2:
> TLS does not support MSG_PEEK, so V1 was broken for tls live
> migrations. For tls live migration, while initializing main channel
> tls handshake is done before we can create other channels, so this
> issue is not possible for tls live migrations. In V2 added a check
> to avoid checking magic number for tls live migration and fallback
> to older method to decide mapping of channels on destination side.
>
> v3:
> 1. Split change in two patches, io patch for read_peek routines,
> migration patch for migration related changes.
> 2. Add flags to io_readv calls to get extra read flags like
> MSG_PEEK.
> 3. Some other minor fixes.
>
> v4:
> 1. Removed common *all_eof routines for read peek and added one
> specific to live migration.
> 2. Updated to use qemu_co_sleep_ns instead of qio_channel_yield.
> 3. Some other minor fixes.
>
> v5:
> 1. Handle busy-wait in migration_channel_read_peek due partial reads.
>
> v6:
> With earlier patch, multifd_load_setup was done only in
> migration_incoming_setup but if multifd channel is received before
> default channel, multifd channels will be uninitialized. Moved
> multifd_load_setup to migration_ioc_process_incoming.
>
>
> manish.mishra (2):
> io: Add support for MSG_PEEK for socket channel
> migration: check magic value for deciding the mapping of channels
>
> chardev/char-socket.c | 4 +--
> include/io/channel.h | 6 ++++
> io/channel-buffer.c | 1 +
> io/channel-command.c | 1 +
> io/channel-file.c | 1 +
> io/channel-null.c | 1 +
> io/channel-socket.c | 17 ++++++++-
> io/channel-tls.c | 1 +
> io/channel-websock.c | 1 +
> io/channel.c | 16 ++++++---
> migration/channel-block.c | 1 +
> migration/channel.c | 45 ++++++++++++++++++++++++
> migration/channel.h | 5 +++
> migration/migration.c | 54 ++++++++++++++++++++---------
> migration/multifd.c | 19 +++++-----
> migration/multifd.h | 2 +-
> migration/postcopy-ram.c | 5 +--
> migration/postcopy-ram.h | 2 +-
> scsi/qemu-pr-helper.c | 2 +-
> tests/qtest/tpm-emu.c | 2 +-
> tests/unit/test-io-channel-socket.c | 1 +
> util/vhost-user-server.c | 2 +-
> 22 files changed, 148 insertions(+), 41 deletions(-)
>
[-- Attachment #2: Type: text/html, Size: 4360 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v6 0/2] check magic value for deciding the mapping of channels
2023-01-31 14:59 ` manish.mishra
@ 2023-01-31 15:17 ` Peter Xu
2023-01-31 17:45 ` manish.mishra
0 siblings, 1 reply; 7+ messages in thread
From: Peter Xu @ 2023-01-31 15:17 UTC (permalink / raw)
To: manish.mishra
Cc: qemu-devel, quintela, dgilbert, lsoaresp, Daniel P . Berrange
On Tue, Jan 31, 2023 at 08:29:08PM +0530, manish.mishra wrote:
> Hi Peter, Daniel,
>
> Just a gentle reminder on this patch if it can be merged, and really
> sorry i see now earlier reminders i sent were on v6[0/2] and somehow you
> were not CCed on that earlier. You were CCed just on v6[1/2] and v6[2,2]
> so that's why probably missed it.
Yes I think so. For some reason I guess Juan missed this set when sending
the most recent PR. We should pick them up soon.
--
Peter Xu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v6 0/2] check magic value for deciding the mapping of channels
2023-01-31 15:17 ` Peter Xu
@ 2023-01-31 17:45 ` manish.mishra
0 siblings, 0 replies; 7+ messages in thread
From: manish.mishra @ 2023-01-31 17:45 UTC (permalink / raw)
To: Peter Xu; +Cc: qemu-devel, quintela, dgilbert, lsoaresp, Daniel P . Berrange
On 31/01/23 8:47 pm, Peter Xu wrote:
> On Tue, Jan 31, 2023 at 08:29:08PM +0530, manish.mishra wrote:
>> Hi Peter, Daniel,
>>
>> Just a gentle reminder on this patch if it can be merged, and really
>> sorry i see now earlier reminders i sent were on v6[0/2] and somehow you
>> were not CCed on that earlier. You were CCed just on v6[1/2] and v6[2,2]
>> so that's why probably missed it.
> Yes I think so. For some reason I guess Juan missed this set when sending
> the most recent PR. We should pick them up soon.
>
Thanks Peter :)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v6 0/2] check magic value for deciding the mapping of channels
@ 2022-12-20 18:44 manish.mishra
2023-01-04 10:52 ` manish.mishra
0 siblings, 1 reply; 7+ messages in thread
From: manish.mishra @ 2022-12-20 18:44 UTC (permalink / raw)
To: qemu-devel; +Cc: quintela, dgilbert, lsoaresp, manish.mishra
Current logic assumes that channel connections on the destination side are
always established in the same order as the source and the first one will
always be the main channel followed by the multifid or post-copy
preemption channel. This may not be always true, as even if a channel has a
connection established on the source side it can be in the pending state on
the destination side and a newer connection can be established first.
Basically causing out of order mapping of channels on the destination side.
Currently, all channels except post-copy preempt send a magic number, this
patch uses that magic number to decide the type of channel. This logic is
applicable only for precopy(multifd) live migration, as mentioned, the
post-copy preempt channel does not send any magic number. Also, tls live
migrations already does tls handshake before creating other channels, so
this issue is not possible with tls, hence this logic is avoided for tls
live migrations. This patch uses MSG_PEEK to check the magic number of
channels so that current data/control stream management remains
un-effected.
v2:
TLS does not support MSG_PEEK, so V1 was broken for tls live
migrations. For tls live migration, while initializing main channel
tls handshake is done before we can create other channels, so this
issue is not possible for tls live migrations. In V2 added a check
to avoid checking magic number for tls live migration and fallback
to older method to decide mapping of channels on destination side.
v3:
1. Split change in two patches, io patch for read_peek routines,
migration patch for migration related changes.
2. Add flags to io_readv calls to get extra read flags like
MSG_PEEK.
3. Some other minor fixes.
v4:
1. Removed common *all_eof routines for read peek and added one
specific to live migration.
2. Updated to use qemu_co_sleep_ns instead of qio_channel_yield.
3. Some other minor fixes.
v5:
1. Handle busy-wait in migration_channel_read_peek due partial reads.
v6:
With earlier patch, multifd_load_setup was done only in
migration_incoming_setup but if multifd channel is received before
default channel, multifd channels will be uninitialized. Moved
multifd_load_setup to migration_ioc_process_incoming.
manish.mishra (2):
io: Add support for MSG_PEEK for socket channel
migration: check magic value for deciding the mapping of channels
chardev/char-socket.c | 4 +--
include/io/channel.h | 6 ++++
io/channel-buffer.c | 1 +
io/channel-command.c | 1 +
io/channel-file.c | 1 +
io/channel-null.c | 1 +
io/channel-socket.c | 17 ++++++++-
io/channel-tls.c | 1 +
io/channel-websock.c | 1 +
io/channel.c | 16 ++++++---
migration/channel-block.c | 1 +
migration/channel.c | 45 ++++++++++++++++++++++++
migration/channel.h | 5 +++
migration/migration.c | 54 ++++++++++++++++++++---------
migration/multifd.c | 19 +++++-----
migration/multifd.h | 2 +-
migration/postcopy-ram.c | 5 +--
migration/postcopy-ram.h | 2 +-
scsi/qemu-pr-helper.c | 2 +-
tests/qtest/tpm-emu.c | 2 +-
tests/unit/test-io-channel-socket.c | 1 +
util/vhost-user-server.c | 2 +-
22 files changed, 148 insertions(+), 41 deletions(-)
--
2.22.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v6 0/2] check magic value for deciding the mapping of channels
2022-12-20 18:44 manish.mishra
@ 2023-01-04 10:52 ` manish.mishra
2023-02-01 15:00 ` Juan Quintela
0 siblings, 1 reply; 7+ messages in thread
From: manish.mishra @ 2023-01-04 10:52 UTC (permalink / raw)
To: qemu-devel; +Cc: quintela, dgilbert, lsoaresp
[-- Attachment #1: Type: text/plain, Size: 3872 bytes --]
Hi Everyone,
I was just checking if it was not missed in holidays and was received. :)
Thanks
Manish Mishra
On 21/12/22 12:14 am, manish.mishra wrote:
> Current logic assumes that channel connections on the destination side are
> always established in the same order as the source and the first one will
> always be the main channel followed by the multifid or post-copy
> preemption channel. This may not be always true, as even if a channel has a
> connection established on the source side it can be in the pending state on
> the destination side and a newer connection can be established first.
> Basically causing out of order mapping of channels on the destination side.
> Currently, all channels except post-copy preempt send a magic number, this
> patch uses that magic number to decide the type of channel. This logic is
> applicable only for precopy(multifd) live migration, as mentioned, the
> post-copy preempt channel does not send any magic number. Also, tls live
> migrations already does tls handshake before creating other channels, so
> this issue is not possible with tls, hence this logic is avoided for tls
> live migrations. This patch uses MSG_PEEK to check the magic number of
> channels so that current data/control stream management remains
> un-effected.
>
> v2:
> TLS does not support MSG_PEEK, so V1 was broken for tls live
> migrations. For tls live migration, while initializing main channel
> tls handshake is done before we can create other channels, so this
> issue is not possible for tls live migrations. In V2 added a check
> to avoid checking magic number for tls live migration and fallback
> to older method to decide mapping of channels on destination side.
>
> v3:
> 1. Split change in two patches, io patch for read_peek routines,
> migration patch for migration related changes.
> 2. Add flags to io_readv calls to get extra read flags like
> MSG_PEEK.
> 3. Some other minor fixes.
>
> v4:
> 1. Removed common *all_eof routines for read peek and added one
> specific to live migration.
> 2. Updated to use qemu_co_sleep_ns instead of qio_channel_yield.
> 3. Some other minor fixes.
>
> v5:
> 1. Handle busy-wait in migration_channel_read_peek due partial reads.
>
> v6:
> With earlier patch, multifd_load_setup was done only in
> migration_incoming_setup but if multifd channel is received before
> default channel, multifd channels will be uninitialized. Moved
> multifd_load_setup to migration_ioc_process_incoming.
>
>
> manish.mishra (2):
> io: Add support for MSG_PEEK for socket channel
> migration: check magic value for deciding the mapping of channels
>
> chardev/char-socket.c | 4 +--
> include/io/channel.h | 6 ++++
> io/channel-buffer.c | 1 +
> io/channel-command.c | 1 +
> io/channel-file.c | 1 +
> io/channel-null.c | 1 +
> io/channel-socket.c | 17 ++++++++-
> io/channel-tls.c | 1 +
> io/channel-websock.c | 1 +
> io/channel.c | 16 ++++++---
> migration/channel-block.c | 1 +
> migration/channel.c | 45 ++++++++++++++++++++++++
> migration/channel.h | 5 +++
> migration/migration.c | 54 ++++++++++++++++++++---------
> migration/multifd.c | 19 +++++-----
> migration/multifd.h | 2 +-
> migration/postcopy-ram.c | 5 +--
> migration/postcopy-ram.h | 2 +-
> scsi/qemu-pr-helper.c | 2 +-
> tests/qtest/tpm-emu.c | 2 +-
> tests/unit/test-io-channel-socket.c | 1 +
> util/vhost-user-server.c | 2 +-
> 22 files changed, 148 insertions(+), 41 deletions(-)
>
[-- Attachment #2: Type: text/html, Size: 4156 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-02-01 15:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-20 18:36 [PATCH v6 0/2] check magic value for deciding the mapping of channels manish.mishra
2023-01-31 14:59 ` manish.mishra
2023-01-31 15:17 ` Peter Xu
2023-01-31 17:45 ` manish.mishra
-- strict thread matches above, loose matches on Subject: below --
2022-12-20 18:44 manish.mishra
2023-01-04 10:52 ` manish.mishra
2023-02-01 15:00 ` Juan Quintela
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).