qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Steven Sistare <steven.sistare@oracle.com>,
	Peter Xu <peterx@redhat.com>,  Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org
Subject: Re: precreate phase
Date: Thu, 10 Oct 2024 23:19:15 +0200	[thread overview]
Message-ID: <670f63b6-529d-42ca-9a9f-acc6f3f07c18@redhat.com> (raw)
In-Reply-To: <b57f8eda-d0ec-469f-8ac2-635f3c8d238b@oracle.com>

On 10/10/24 22:07, Steven Sistare wrote:
> 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.

Can you provide an example of the commands?

Moving migration_object_init() earlier sounds like a good idea anyway!

Paolo

> qemu enters the phase if qemu is started with the -precreate option.
> The phase ends when the user sends a precreate-exit command.
> Qemu then calls cpr_load_state and reads from the normal migration 
> connection
> as in the existing design, including the HUP.
> 
> (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.
> 
> 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(-)
> 
> 
> 
> 



  parent reply	other threads:[~2024-10-10 21:19 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
2024-10-10 21:19 ` Paolo Bonzini [this message]
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=670f63b6-529d-42ca-9a9f-acc6f3f07c18@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=farosas@suse.de \
    --cc=peterx@redhat.com \
    --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).