qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: Steven Sistare <steven.sistare@oracle.com>, qemu-devel@nongnu.org
Subject: Re: precreate phase
Date: Thu, 10 Oct 2024 17:16:11 -0400	[thread overview]
Message-ID: <ZwhEG40a5AXW23KI@x1n> (raw)
In-Reply-To: <877cafsmuz.fsf@suse.de>

On Thu, Oct 10, 2024 at 05:51:16PM -0300, Fabiano Rosas wrote:
> Steven Sistare <steven.sistare@oracle.com> writes:
> 
> > Peter, Fabiano,
> >
> > I have a nice solution that allows dest qemu configuration with cpr-transfer.
> > I define a new qemu initialization phase called 'precreate' which occurs
> > before most backends or devices have been created.  The only exception
> > is monitor devices and the qtest device and their chardevs, which are created.
> > I untangled dependencies so that that migration_object_init can be called
> > before this phase.  The monitor accepts commands during this phase and can
> > receive migration configuration commands.  qemu starts listening on the
> > normal migration URI during this phase (which can come from either the
> > qemu command line or from a migrate_incoming command) so the user can
> > issue query-migrate to get the socket-address for dynamically allocated
> > port numbers.
> >
> > qemu enters the phase if qemu is started with the -precreate option.
> > The phase ends when the user sends a precreate-exit command.

Perhaps x-exit-precreate, just to match x-exit-preconfig?

> > Qemu then calls cpr_load_state and reads from the normal migration connection
> > as in the existing design, including the HUP.

I didn't fully get this part - can the cpr-uri channel completely avoided
then?  Do you mean the HUP can be avoided with it (alone with -cpr-uri dest
qemu cmdline)?

> >
> > (This sounds like the preconfig phase, but that occurs too late, after
> > backends have been created.)
> >
> > I implemented this scheme for another reason but abandoned it, so I need
> > a few days to rebase it and test.  It is not small, and requires approvals
> > from additional maintainers.  Let me know if you think this is the right
> > solution, and I will revive it.
> 
> Seems reasonable to me, given the requirements we're working with. Was
> there a branch we could skim somewhere?

Yes a tree can be clearer, with an example usage.

This design looks even cleaner to me (but maybe misunderstood some part),
it may slow down the merge because we need broader reviews.  So it's just
that it might have higher chance miss 9.2.

> 
> >
> > Preview:
> >
> >    0725d70 vl: precreate phase
> >    edd2dee net: cleanup for precreate phase
> >    4733c00 accel: encapsulate search state
> >    6d26ea4 accel: accel preinit function
> >    518e737 accel: split configure_accelerators
> >    8ef936b accel: delete accelerator and machine props
> >    b5c2a84 accel: set accelerator and machine props earlier
> >    56890a0 migration: init early
> >    76506b2 monitor: chardev name
> >    e85111d qom: get properties
> >    8356f7e qemu-option: filtered foreach
> >    fb6cc98 qemu-options: pass object to filter
> >    bdfec1b monitor: connect in precreate
> >    8f2f292 qtest: connect in precreate
> >    629cb50 migration: connect URI early
> >    0ae530e migration: allow commands during precreate and preconfig
> >
> >   accel/accel-system.c            |   2 -
> >   accel/kvm/kvm-all.c             |  58 +++++---
> >   accel/xen/xen-all.c             |  11 +-
> >   hmp-commands.hx                 |  20 +++
> >   include/migration/misc.h        |   2 +
> >   include/monitor/hmp.h           |   1 +
> >   include/monitor/monitor.h       |   1 +
> >   include/qapi/visitor.h          |   1 +
> >   include/qemu/accel.h            |   1 +
> >   include/qemu/option.h           |   5 +
> >   include/qom/object_interfaces.h |   2 +
> >   include/sysemu/sysemu.h         |   3 +
> >   migration/migration.c           |  31 +++++
> >   monitor/hmp-cmds.c              |   8 ++
> >   monitor/monitor.c               |  21 +++
> >   net/net.c                       |   4 +-
> >   qapi/migration.json             |  16 ++-
> >   qapi/misc.json                  |  23 +++-
> >   qemu-options.hx                 |  13 ++
> >   qom/object_interfaces.c         |  27 ++--
> >   system/vl.c                     | 291 +++++++++++++++++++++++++++++++---------
> >   target/i386/nvmm/nvmm-all.c     |  10 +-
> >   target/i386/whpx/whpx-all.c     |  14 +-
> >   util/qemu-option.c              |  25 ++++
> >   24 files changed, 471 insertions(+), 119 deletions(-)
> 

-- 
Peter Xu



  reply	other threads:[~2024-10-10 21:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 20:07 precreate phase Steven Sistare
2024-10-10 20:51 ` Fabiano Rosas
2024-10-10 21:16   ` Peter Xu [this message]
2024-10-10 21:19 ` Paolo Bonzini
2024-10-10 21:48   ` 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=ZwhEG40a5AXW23KI@x1n \
    --to=peterx@redhat.com \
    --cc=farosas@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=steven.sistare@oracle.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).