qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Steven Sistare <steven.sistare@oracle.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, Fabiano Rosas <farosas@suse.de>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [RFC V1 0/6] Live update: cpr-transfer
Date: Sat, 20 Jul 2024 16:07:50 -0400	[thread overview]
Message-ID: <90a01b2b-6a72-475f-9232-3af73d1618cf@oracle.com> (raw)
In-Reply-To: <Zpk2bfjS1Wu2QbcO@x1n>

On 7/18/2024 11:36 AM, Peter Xu wrote:
> On Sun, Jun 30, 2024 at 12:44:02PM -0700, Steve Sistare wrote:
>> What?
>>
>> This patch series adds the live migration cpr-transfer mode, which
>> allows the user to transfer a guest to a new QEMU instance on the same
>> host.  It is identical to cpr-exec in most respects, except as described
>> below.
> 
> I definitely prefer this one more than the exec solution, thanks for trying
> this out.  It's a matter of whether we'll need both, my answer would be
> no..
> 
>>
>> The new user-visible interfaces are:
>>    * cpr-transfer (MigMode migration parameter)
>>    * cpr-uri (migration parameter)
> 
> I wonder whether this parameter can be avoided already, maybe we can let
> cpr-transfer depend on unix socket in -incoming, then integrate fd sharing
> in the same channel?

You saw the answer in another thread, but I repeat it here for others benefit:

   "CPR state cannot be sent over the normal migration channel, because devices
    and backends are created prior to reading the channel, so this mode sends
    CPR state over a second migration channel that is not visible to the user.
    New QEMU reads the second channel prior to creating devices or backends."

- Steve

>>    * cpr-uri (command-line argument)
>>
>> In this mode, the user starts new QEMU on the same host as old QEMU, with
>> the same arguments as old QEMU, plus the -incoming and the -cpr-uri options.
>> The user issues the migrate command to old QEMU, which stops the VM, saves
>> state to the migration channels, and enters the postmigrate state.  Execution
>> resumes in new QEMU.
>>
>> This mode requires a second migration channel, specified by the cpr-uri
>> migration property on the outgoing side, and by the cpr-uri QEMU command-line
>> option on the incoming side.  The channel must be a type, such as unix socket,
>> that supports SCM_RIGHTS.
>>
>> This series depends on the series "Live update: cpr-exec mode".
>>
>> Why?
>>
>> cpr-transfer offers the same benefits as cpr-exec mode, but with a model
>> for launching new QEMU that may be more natural for some management packages.
>>
>> How?
>>
>> The file descriptors are kept open by sending them to new QEMU via the
>> cpr-uri, which must support SCM_RIGHTS.
>>
>> Example:
>>
>> In this example, we simply restart the same version of QEMU, but in
>> a real scenario one would use a new QEMU binary path in terminal 2.
>>
>>    Terminal 1: start old QEMU
>>    # qemu-kvm -monitor stdio -object
>>    memory-backend-file,id=ram0,size=4G,mem-path=/dev/shm/ram0,share=on
>>    -m 4G -machine anon-alloc=memfd ...
>>
>>    Terminal 2: start new QEMU
>>    # qemu-kvm ... -incoming unix:vm.sock -cpr-uri unix:cpr.sock
>>
>>    Terminal 1:
>>    QEMU 9.1.50 monitor - type 'help' for more information
>>    (qemu) info status
>>    VM status: running
>>    (qemu) migrate_set_parameter mode cpr-transfer
>>    (qemu) migrate_set_parameter cpr-uri unix:cpr.sock
>>    (qemu) migrate -d unix:vm.sock
>>    (qemu) info status
>>    VM status: paused (postmigrate)
>>
>>    Terminal 2:
>>    QEMU 9.1.50 monitor - type 'help' for more information
>>    (qemu) info status
>>    VM status: running
>>
>> Steve Sistare (6):
>>    migration: SCM_RIGHTS for QEMUFile
>>    migration: VMSTATE_FD
>>    migration: cpr-transfer save and load
>>    migration: cpr-uri parameter
>>    migration: cpr-uri option
>>    migration: cpr-transfer mode
>>
>>   include/migration/cpr.h        |  4 ++
>>   include/migration/vmstate.h    |  9 +++++
>>   migration/cpr-transfer.c       | 81 +++++++++++++++++++++++++++++++++++++++++
>>   migration/cpr.c                | 16 +++++++-
>>   migration/meson.build          |  1 +
>>   migration/migration-hmp-cmds.c | 10 +++++
>>   migration/migration.c          | 37 +++++++++++++++++++
>>   migration/options.c            | 29 +++++++++++++++
>>   migration/options.h            |  1 +
>>   migration/qemu-file.c          | 83 ++++++++++++++++++++++++++++++++++++++++--
>>   migration/qemu-file.h          |  2 +
>>   migration/ram.c                |  1 +
>>   migration/trace-events         |  2 +
>>   migration/vmstate-types.c      | 33 +++++++++++++++++
>>   qapi/migration.json            | 38 ++++++++++++++++++-
>>   qemu-options.hx                |  8 ++++
>>   stubs/vmstate.c                |  7 ++++
>>   system/vl.c                    |  3 ++
>>   18 files changed, 359 insertions(+), 6 deletions(-)
>>   create mode 100644 migration/cpr-transfer.c
>>
>> -- 
>> 1.8.3.1
>>
> 


  reply	other threads:[~2024-07-20 20:08 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-30 19:44 [RFC V1 0/6] Live update: cpr-transfer Steve Sistare
2024-06-30 19:44 ` [RFC V1 1/6] migration: SCM_RIGHTS for QEMUFile Steve Sistare
2024-08-02  8:20   ` Euan Turner
2024-08-05 19:06     ` Steven Sistare
2024-08-15 20:58   ` Peter Xu
2024-08-16 15:13     ` Steven Sistare
2024-08-16 15:51       ` Peter Xu
2024-06-30 19:44 ` [RFC V1 2/6] migration: VMSTATE_FD Steve Sistare
2024-06-30 19:44 ` [RFC V1 3/6] migration: cpr-transfer save and load Steve Sistare
2024-06-30 19:44 ` [RFC V1 4/6] migration: cpr-uri parameter Steve Sistare
2024-08-15 20:46   ` Peter Xu
2024-08-16 15:13     ` Steven Sistare
2024-06-30 19:44 ` [RFC V1 5/6] migration: cpr-uri option Steve Sistare
2024-06-30 19:44 ` [RFC V1 6/6] migration: cpr-transfer mode Steve Sistare
2024-08-13 21:27   ` Steven Sistare
2024-07-18 15:36 ` [RFC V1 0/6] Live update: cpr-transfer Peter Xu
2024-07-20 20:07   ` Steven Sistare [this message]
2024-08-15 20:28     ` Peter Xu
2024-08-16  8:42       ` Daniel P. Berrangé
2024-08-16 15:14         ` Steven Sistare
2024-08-16 16:07           ` Peter Xu
2024-08-16 15:13       ` Steven Sistare
2024-08-16 15:23         ` Peter Xu
2024-08-16 15:36           ` Daniel P. Berrangé
2024-08-16 15:59             ` Peter Xu
2024-08-16 18:34               ` Steven Sistare
2024-08-20 16:29                 ` Steven Sistare
2024-09-04 21:14                   ` Steven Sistare
2024-09-04 22:09                     ` Peter Xu
2024-09-05 17:30                   ` 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=90a01b2b-6a72-475f-9232-3af73d1618cf@oracle.com \
    --to=steven.sistare@oracle.com \
    --cc=armbru@redhat.com \
    --cc=farosas@suse.de \
    --cc=peterx@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).