From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "manish.mishra" <manish.mishra@nutanix.com>
Cc: qemu-devel@nongnu.org, peterx@redhat.com,
Prerna Saxena <prerna.saxena@nutanix.com>
Subject: Re: [PATCH] migration: check magic value for deciding the mapping of channels
Date: Thu, 3 Nov 2022 09:29:45 +0000 [thread overview]
Message-ID: <Y2OKCel2FlMQw+bI@redhat.com> (raw)
In-Reply-To: <e5f69a86-f625-3cdb-4a25-065a0612548e@nutanix.com>
On Thu, Nov 03, 2022 at 02:50:25PM +0530, manish.mishra wrote:
>
> On 01/11/22 9:15 pm, Daniel P. Berrangé wrote:
> > On Tue, Nov 01, 2022 at 09:10:14PM +0530, manish.mishra wrote:
> > > On 01/11/22 8:21 pm, Daniel P. Berrangé wrote:
> > > > On Tue, Nov 01, 2022 at 02:30:29PM +0000, manish.mishra wrote:
> > > > > diff --git a/migration/migration.c b/migration/migration.c
> > > > > index 739bb683f3..f4b6f278a9 100644
> > > > > --- a/migration/migration.c
> > > > > +++ b/migration/migration.c
> > > > > @@ -733,31 +733,40 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)
> > > > > {
> > > > > MigrationIncomingState *mis = migration_incoming_get_current();
> > > > > Error *local_err = NULL;
> > > > > - bool start_migration;
> > > > > QEMUFile *f;
> > > > > + bool default_channel = true;
> > > > > + uint32_t channel_magic = 0;
> > > > > + int ret = 0;
> > > > > - if (!mis->from_src_file) {
> > > > > - /* The first connection (multifd may have multiple) */
> > > > > + if (migrate_use_multifd() && !migration_in_postcopy()) {
> > > > > + ret = qio_channel_read_peek_all(ioc, (void *)&channel_magic,
> > > > > + sizeof(channel_magic), &local_err);
> > > > > +
> > > > > + if (ret != 1) {
> > > > > + error_propagate(errp, local_err);
> > > > > + return;
> > > > > + }
> > > > ....and thus this will fail for TLS channels AFAICT.
> > > Yes, thanks for quick review Daniel. You pointed this earlier too, sorry missed it, will put another check !migrate_use_tls() in V2.
> > But we need this problem fixed with TLS too, so just excluding it
> > isn't right. IMHO we need to modify the migration code so we can
> > read the magic earlier, instead of peeking.
> >
> >
> > With regards,
> > Daniel
>
> Hi Daniel, I was trying tls migrations. What i see is that tls session
> creation does handshake. So if we read ahead in ioc_process_incoming
> for default channel. Because client sends magic only after multiFD
> channels are setup, which too requires tls handshake.
By the time we get to migrate_ioc_process_incoming, the TLS handshake
has already been performed.
migration_channel_process_incoming
-> migration_ioc_process_incoming
vs
migration_channel_process_incoming
-> migration_tls_channel_process_incoming
-> migration_tls_incoming_handshake
-> migration_channel_process_incoming
-> migration_ioc_process_incoming
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:[~2022-11-03 9:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 14:30 [PATCH] migration: check magic value for deciding the mapping of channels manish.mishra
2022-11-01 14:38 ` manish.mishra
2022-11-01 14:51 ` Daniel P. Berrangé
2022-11-01 15:40 ` manish.mishra
2022-11-01 15:45 ` Daniel P. Berrangé
2022-11-01 15:49 ` manish.mishra
2022-11-03 9:20 ` manish.mishra
2022-11-03 9:29 ` Daniel P. Berrangé [this message]
2022-11-03 16:34 ` manish.mishra
2022-11-03 17:27 ` Daniel P. Berrangé
2022-11-03 17:36 ` manish.mishra
2022-11-03 17:57 ` Daniel P. Berrangé
2022-11-03 18:17 ` manish.mishra
2022-11-03 18:53 ` manish.mishra
2022-11-03 18:54 ` manish.mishra
2022-11-14 16:51 ` Peter Xu
2022-11-15 7:07 ` manish.mishra
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=Y2OKCel2FlMQw+bI@redhat.com \
--to=berrange@redhat.com \
--cc=manish.mishra@nutanix.com \
--cc=peterx@redhat.com \
--cc=prerna.saxena@nutanix.com \
--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.