qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC V1 0/6] Live update: cpr-transfer
@ 2024-06-30 19:44 Steve Sistare
  2024-06-30 19:44 ` [RFC V1 1/6] migration: SCM_RIGHTS for QEMUFile Steve Sistare
                   ` (6 more replies)
  0 siblings, 7 replies; 30+ messages in thread
From: Steve Sistare @ 2024-06-30 19:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Xu, Fabiano Rosas, Markus Armbruster, Steve Sistare

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. 

The new user-visible interfaces are:
  * cpr-transfer (MigMode migration parameter)
  * cpr-uri (migration parameter)
  * 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



^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2024-09-05 17:31 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).