qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Prasad Pandit <ppandit@redhat.com>
Cc: qemu-devel@nongnu.org, Fabiano Rosas <farosas@suse.de>,
	Prasad Pandit <pjp@fedoraproject.org>
Subject: Re: [PATCH 2/5] migration/postcopy: magic value for postcopy channel
Date: Tue, 5 Nov 2024 08:00:14 -0500	[thread overview]
Message-ID: <ZyoW3ue3WTQ3Di1d@x1n> (raw)
In-Reply-To: <CAE8KmOzuGxdU7zp+vsf1yY_FP8bf-KTv7UJ+8h6bfmkE=0H-bA@mail.gmail.com>

On Tue, Nov 05, 2024 at 04:49:23PM +0530, Prasad Pandit wrote:
> On Mon, 4 Nov 2024 at 22:48, Peter Xu <peterx@redhat.com> wrote:
> > Firstly, we'll need a way to tell mgmt that the new qemu binary supports
> > enablement of both multifd + postcopy feature.  That can be done with a
> >
> >   "features": [ "postcopy-with-multifd-precopy" ]
> >
> > Flag attached to the QMP "migrate" command.
> 
> * IIUC, currently virsh(1)/libvirtd(8) sends the migration command to
> the destination to inform it of the migration features to use, whether
> to use multifd or postcopy or none etc. Based on that the destination
> QEMU prepares to accept incoming VM. Not sure how/what above flag
> shall benefit.

See:

https://www.qemu.org/docs/master/devel/qapi-code-gen.html

        Sometimes, the behaviour of QEMU changes compatibly, but without a
        change in the QMP syntax (usually by allowing values or operations
        that previously resulted in an error). QMP clients may still need
        to know whether the extension is available.

        For this purpose, a list of features can be specified for
        definitions, enumeration values, and struct members. Each feature
        list member can either be { 'name': STRING, '*if': COND }, or
        STRING, which is shorthand for { 'name': STRING }.

> 
> > Then, I think we don't need a magic for preempt channel, because new qemu
> > binaries (after 7.2) have no issue on out-of-order connections between main
> > / preempt channel.  Preempt channel is always connected later than main.
> >
> > It means in the test logic of "which channel is which", it should be:
> >
> >   - If it's a multifd channel (check multifd header match), it's a multifd
> >     channel, otherwise,
> >
> >     - if main channel is not present yet, it must be the main channel (and
> >       we can double check the main channel magic), otherwise,
> >
> >     - it's the preempt channel
> >
> > With that, I think we can drop the new magic sent here.
> 
> * Sending magic value on the postcopy channel only makes it consistent
> with other channels. There's no harm in sending it. Explicitly
> defining/sending the magic value is better than leaving it for the
> code/reader to figure it out. Is there a compelling reason to drop it?
> IMO, we should either define/send the magic value for all channels or
> none. Both ways are consistent. Defining it for few and not for others
> does not seem right.

It's a legacy issue as not all features are developed together, and that
was planned to be fixed together with handshake.  I think the handshake
could introduce one header on top to pair channels.

IMHO it is an overkill to add a feature now if it works even if tricky,
because it's not the 1st day it was tricky. And we're going to have another
header very soon..

Thanks,

-- 
Peter Xu



  reply	other threads:[~2024-11-05 13:01 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 15:09 [PATCH 0/5] Allow to enable multifd and postcopy migration together Prasad Pandit
2024-10-29 15:09 ` [PATCH 1/5] migration/multifd: move macros to multifd header Prasad Pandit
2024-10-29 15:09 ` [PATCH 2/5] migration/postcopy: magic value for postcopy channel Prasad Pandit
     [not found]   ` <ZyTnBwpOwXcHGGPJ@x1n>
2024-11-04 12:32     ` Prasad Pandit
2024-11-04 17:18       ` Peter Xu
2024-11-05 11:19         ` Prasad Pandit
2024-11-05 13:00           ` Peter Xu [this message]
2024-11-06 12:19             ` Prasad Pandit
2024-11-06 13:11               ` Fabiano Rosas
2024-11-07 12:05                 ` Prasad Pandit
2024-11-07 12:11                   ` Fabiano Rosas
2024-11-07 12:33                   ` Daniel P. Berrangé
2024-11-07 16:17                     ` Peter Xu
2024-11-07 16:57                       ` Daniel P. Berrangé
2024-11-07 17:45                         ` Peter Xu
2024-11-08 12:37                           ` Prasad Pandit
2024-11-08 13:25                             ` Fabiano Rosas
2024-11-06 16:00               ` Peter Xu
2024-11-07 11:52                 ` Prasad Pandit
2024-11-07 15:56                   ` Peter Xu
2024-10-29 15:09 ` [PATCH 3/5] migration: remove multifd check with postcopy Prasad Pandit
     [not found]   ` <ZyTnWYyHlrJUYQRB@x1n>
2024-11-04 12:23     ` Prasad Pandit
2024-11-04 16:52       ` Peter Xu
2024-11-05  9:50         ` Prasad Pandit
2024-10-29 15:09 ` [PATCH 4/5] migration: refactor ram_save_target_page functions Prasad Pandit
     [not found]   ` <ZyToBbvfWkIZ_40W@x1n>
2024-11-04 11:56     ` Prasad Pandit
2024-11-04 17:00       ` Peter Xu
2024-11-05 10:01         ` Prasad Pandit
2024-11-05 13:01           ` Peter Xu
2024-10-29 15:09 ` [PATCH 5/5] migration: enable multifd and postcopy together Prasad Pandit
2024-11-04 17:48   ` Peter Xu
2024-11-05 11:54     ` Prasad Pandit
2024-11-05 16:55       ` Peter Xu

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=ZyoW3ue3WTQ3Di1d@x1n \
    --to=peterx@redhat.com \
    --cc=farosas@suse.de \
    --cc=pjp@fedoraproject.org \
    --cc=ppandit@redhat.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 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).