Re: [PATCH V2 02/13] migration: cpr-state

2024-10-07 Thread Steven Sistare
On 10/7/2024 10:14 AM, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:33PM -0700, Steve Sistare wrote: CPR must save state that is needed after QEMU is restarted, when devices are realized. Thus the extra state cannot be saved in the migration stream, as objects must already exist before that st

Re: [PATCH V2 09/13] migration: cpr-transfer save and load

2024-10-07 Thread Steven Sistare
On 10/7/2024 12:47 PM, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:40PM -0700, Steve Sistare wrote: Add functions to create a QEMUFile based on a unix URI, for saving or loading, for use by cpr-transfer mode to preserve CPR state. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu There'

Re: [PATCH V2 03/13] migration: save cpr mode

2024-10-07 Thread Steven Sistare
On 10/7/2024 11:18 AM, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:34PM -0700, Steve Sistare wrote: Save the mode in CPR state, so the user does not need to explicitly specify it for the target. Modify migrate_mode() so it returns the incoming mode on the target. Signed-off-by: Steve Sistare

Re: [PATCH V2 01/13] machine: alloc-anon option

2024-10-07 Thread Steven Sistare
On 10/7/2024 11:36 AM, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:32PM -0700, Steve Sistare wrote: diff --git a/system/trace-events b/system/trace-events index 074d001..4669411 100644 --- a/system/trace-events +++ b/system/trace-events @@ -47,3 +47,6 @@ dirtylimit_vcpu_execute(int cpu_index,

Re: [PATCH V2 08/13] migration: VMSTATE_FD

2024-10-07 Thread Steven Sistare
On 10/7/2024 12:36 PM, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:39PM -0700, Steve Sistare wrote: Define VMSTATE_FD for declaring a file descriptor field in a VMStateDescription. Signed-off-by: Steve Sistare --- include/migration/vmstate.h | 9 + migration/vmstate-types.c | 3

Re: [PATCH V2 03/13] migration: save cpr mode

2024-10-08 Thread Steven Sistare
On 10/7/2024 4:10 PM, Peter Xu wrote: On Mon, Oct 07, 2024 at 03:31:09PM -0400, Steven Sistare wrote: On 10/7/2024 11:18 AM, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:34PM -0700, Steve Sistare wrote: Save the mode in CPR state, so the user does not need to explicitly specify it for the

Re: [PATCH V2 13/13] migration: cpr-transfer mode

2024-10-08 Thread Steven Sistare
On 10/8/2024 2:47 PM, Peter Xu wrote: On Tue, Oct 08, 2024 at 03:28:30PM -0300, Fabiano Rosas wrote: +/* Close cpr socket to tell source that we are listening */ +cpr_state_close(); Would it be possible to use some explicit reply message to mark this? In theory yes, but I fear that u

Re: [PATCH V2 13/13] migration: cpr-transfer mode

2024-10-08 Thread Steven Sistare
On 10/8/2024 3:11 PM, Fabiano Rosas wrote: Peter Xu writes: On Tue, Oct 08, 2024 at 03:28:30PM -0300, Fabiano Rosas wrote: +/* Close cpr socket to tell source that we are listening */ +cpr_state_close(); Would it be possible to use some explicit reply message to mark this? In theo

Re: [PATCH V2 13/13] migration: cpr-transfer mode

2024-10-08 Thread Steven Sistare
On 10/8/2024 11:45 AM, Peter Xu wrote: On Mon, Oct 07, 2024 at 04:39:25PM -0400, Steven Sistare wrote: On 10/7/2024 3:44 PM, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:44PM -0700, Steve Sistare wrote: Add the cpr-transfer migration mode. Usage: qemu-system-$arch -machine anon-alloc

Re: [PATCH V2 04/13] migration: stop vm earlier for cpr

2024-10-08 Thread Steven Sistare
On 10/8/2024 11:35 AM, Peter Xu wrote: On Mon, Oct 07, 2024 at 04:52:43PM -0400, Steven Sistare wrote: On 10/7/2024 11:27 AM, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:35PM -0700, Steve Sistare wrote: Stop the vm earlier for cpr, to guarantee consistent device state when CPR state is

Re: [PATCH V2 13/13] migration: cpr-transfer mode

2024-10-07 Thread Steven Sistare
On 10/7/2024 3:44 PM, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:44PM -0700, Steve Sistare wrote: Add the cpr-transfer migration mode. Usage: qemu-system-$arch -machine anon-alloc=memfd ... start new QEMU with "-incoming -cpr-uri " Issue commands to old QEMU: migrate_set_param

Re: [PATCH V2 04/13] migration: stop vm earlier for cpr

2024-10-07 Thread Steven Sistare
On 10/7/2024 11:27 AM, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:35PM -0700, Steve Sistare wrote: Stop the vm earlier for cpr, to guarantee consistent device state when CPR state is saved. Could you add some more info on why this order matters? E.g., qmp_migrate should switch migration st

Re: [RFC V1 04/14] accel: set accelerator and machine props earlier

2024-10-18 Thread Steven Sistare
On 10/18/2024 11:08 AM, Fabiano Rosas wrote: Steve Sistare writes: Make all global and compat properties available before the first objects are created. Set accelerator compatibility properties in configure_accelerators, when the accelerator is chosen, and call configure_accelerators earlier.

Re: [RFC V1 04/14] accel: set accelerator and machine props earlier

2024-10-18 Thread Steven Sistare
On 10/18/2024 11:40 AM, Steven Sistare wrote: On 10/18/2024 11:32 AM, Steven Sistare wrote: On 10/18/2024 11:08 AM, Fabiano Rosas wrote: Steve Sistare writes: Make all global and compat properties available before the first objects are created.  Set accelerator compatibility properties in

Re: [RFC V1 04/14] accel: set accelerator and machine props earlier

2024-10-18 Thread Steven Sistare
On 10/18/2024 11:32 AM, Steven Sistare wrote: On 10/18/2024 11:08 AM, Fabiano Rosas wrote: Steve Sistare writes: Make all global and compat properties available before the first objects are created.  Set accelerator compatibility properties in configure_accelerators, when the accelerator is

Re: [RFC V1 00/14] precreate phase

2024-10-21 Thread Steven Sistare
On 10/17/2024 11:53 AM, Peter Xu wrote: On Thu, Oct 17, 2024 at 11:19:51AM -0400, Steven Sistare wrote: On 10/17/2024 11:14 AM, Steve Sistare wrote: Define a new qemu initialization phase called 'precreate' which occurs before most backends or devices have been created. The only ex

Re: [PATCH V2 05/13] physmem: preserve ram blocks for cpr

2024-10-08 Thread Steven Sistare
On 10/7/2024 12:28 PM, Peter Xu wrote: On Mon, Oct 07, 2024 at 11:49:25AM -0400, Peter Xu wrote: On Mon, Sep 30, 2024 at 12:40:36PM -0700, Steve Sistare wrote: Save the memfd for anonymous ramblocks in CPR state, along with a name that uniquely identifies it. The block's idstr is not yet set,

Re: [PATCH V2 13/13] migration: cpr-transfer mode

2024-10-10 Thread Steven Sistare
On 10/9/2024 6:08 PM, Fabiano Rosas wrote: Peter Xu writes: On Wed, Oct 09, 2024 at 04:18:31PM -0400, Steven Sistare wrote: Yes, I am also brainstorming along these lines, looking for more gotcha's, but its a big design change. I don't love it so far. These issues all creep in

Re: [PATCH V2 13/13] migration: cpr-transfer mode

2024-10-10 Thread Steven Sistare
On 10/9/2024 4:36 PM, Peter Xu wrote: On Wed, Oct 09, 2024 at 04:09:45PM -0400, Steven Sistare wrote: On 10/9/2024 3:06 PM, Peter Xu wrote: On Wed, Oct 09, 2024 at 02:43:44PM -0400, Steven Sistare wrote: On 10/8/2024 3:48 PM, Peter Xu wrote: On Tue, Oct 08, 2024 at 04:11:38PM -0300, Fabiano

precreate phase

2024-10-10 Thread Steven Sistare
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,

Re: [PATCH V2 13/13] migration: cpr-transfer mode

2024-10-25 Thread Steven Sistare
On 10/10/2024 5:23 PM, Peter Xu wrote: On Thu, Oct 10, 2024 at 04:06:13PM -0400, Steven Sistare wrote: vhost requires us to stop the vm early: qmp_migrate stop vm migration_call_notifiers MIG_EVENT_PRECOPY_CPR_SETUP vhost_cpr_notifier vhost_reset_device - must be

Re: [RFC V1 00/14] precreate phase

2024-10-24 Thread Steven Sistare
On 10/23/2024 12:31 PM, Paolo Bonzini wrote: On 10/17/24 17:14, Steve Sistare wrote: Define a new qemu initialization phase called 'precreate' which occurs before most backends or devices have been created.  The only exception is monitor and qtest devices and their associated chardevs. QEMU run

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-04 Thread Steven Sistare
On 11/4/2024 5:39 AM, David Hildenbrand wrote: On 01.11.24 14:47, Steve Sistare wrote: Allocate anonymous memory using mmap MAP_ANON or memfd_create depending on the value of the anon-alloc machine property.  This option applies to memory allocated as a side effect of creating various devices. I

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-04 Thread Steven Sistare
On 11/4/2024 3:15 PM, David Hildenbrand wrote: On 04.11.24 20:51, David Hildenbrand wrote: On 04.11.24 18:38, Steven Sistare wrote: On 11/4/2024 5:39 AM, David Hildenbrand wrote: On 01.11.24 14:47, Steve Sistare wrote: Allocate anonymous memory using mmap MAP_ANON or memfd_create depending

Re: [RFC V1 00/14] precreate phase

2024-10-25 Thread Steven Sistare
On 10/25/2024 9:43 AM, Daniel P. Berrangé wrote: On Fri, Oct 25, 2024 at 09:33:51AM -0400, Steven Sistare wrote: On 10/25/2024 4:46 AM, Daniel P. Berrangé wrote: On Thu, Oct 24, 2024 at 05:16:14PM -0400, Steven Sistare wrote: Regarding: "what you want is effectively to execute mo

Re: [RFC V1 00/14] precreate phase

2024-10-25 Thread Steven Sistare
On 10/25/2024 4:46 AM, Daniel P. Berrangé wrote: On Thu, Oct 24, 2024 at 05:16:14PM -0400, Steven Sistare wrote: Regarding: "what you want is effectively to execute monitor commands from the migration stream" That is not the goal of this series. It could be someone else's g

Re: [RFC V1 02/14] accel: accel preinit function

2024-10-23 Thread Steven Sistare
On 10/23/2024 11:53 AM, Paolo Bonzini wrote: On 10/17/24 17:14, Steve Sistare wrote: Extract the first part of the AccelState init_machine function into a new function preinit, which can be called without knowing any machine properties.  For now call preinit and init_machine at the same place, s

Re: [RFC V1 05/14] migration: init and listen during precreate

2024-10-23 Thread Steven Sistare
On 10/21/2024 5:05 PM, Fabiano Rosas wrote: Steve Sistare writes: Initialize the migration object as early as possible so that migration configuration commands may be sent during the precreate phase. Also, start listening for the incoming migration connection during precreate, so that the lis

Re: [RFC V1 02/14] accel: accel preinit function

2024-10-23 Thread Steven Sistare
On 10/21/2024 10:54 AM, Peter Xu wrote: On Thu, Oct 17, 2024 at 08:14:03AM -0700, Steve Sistare wrote: Extract the first part of the AccelState init_machine function into a new function preinit, which can be called without knowing any machine properties. For now call preinit and init_machine at

Re: [RFC V1 11/14] monitor: connect in precreate

2024-10-23 Thread Steven Sistare
On 10/23/2024 12:05 PM, Paolo Bonzini wrote: On 10/17/24 17:14, Steve Sistare wrote: Complete monitor connections as early as possible, prior to qemu_create_early_backends, so the user can issue commands during the precreate phase. Make a list of the chardev's referenced by all monitors.  Creat

Re: [RFC V1 13/14] net: cleanup for precreate phase

2024-10-23 Thread Steven Sistare
On 10/21/2024 3:20 PM, Peter Xu wrote: On Thu, Oct 17, 2024 at 08:14:14AM -0700, Steve Sistare wrote: Guard against unconfigured state if cleanup is called early, such as during the precreate phase. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu One nitpick.. --- net/net.c | 4 +++-

Re: [RFC V1 14/14] migration: allow commands during precreate and preconfig

2024-10-23 Thread Steven Sistare
On 10/21/2024 3:36 PM, Peter Xu wrote: On Thu, Oct 17, 2024 at 08:14:15AM -0700, Steve Sistare wrote: Allow various migration commands during the precreate and preconfig phases so migration may be set up and initiated at that time. Signed-off-by: Steve Sistare --- hmp-commands.hx | 2 ++

Re: [RFC V1 11/14] monitor: connect in precreate

2024-10-23 Thread Steven Sistare
On 10/21/2024 3:28 PM, Peter Xu wrote: On Thu, Oct 17, 2024 at 08:14:12AM -0700, Steve Sistare wrote: Complete monitor connections as early as possible, prior to qemu_create_early_backends, so the user can issue commands during the precreate phase. Make a list of the chardev's referenced by all

Re: [RFC V1 04/14] accel: set accelerator and machine props earlier

2024-10-23 Thread Steven Sistare
On 10/23/2024 12:00 PM, Paolo Bonzini wrote: On 10/17/24 17:14, Steve Sistare wrote: Make all global and compat properties available before the first objects are created.  Set accelerator compatibility properties in configure_accelerators, when the accelerator is chosen, and call configure_accel

Re: [RFC V1 04/14] accel: set accelerator and machine props earlier

2024-10-23 Thread Steven Sistare
On 10/22/2024 4:30 AM, David Hildenbrand wrote: On 18.10.24 21:15, Steven Sistare wrote: On 10/18/2024 11:40 AM, Steven Sistare wrote: On 10/18/2024 11:32 AM, Steven Sistare wrote: On 10/18/2024 11:08 AM, Fabiano Rosas wrote: Steve Sistare writes: Make all global and compat properties

Re: [RFC V1 04/14] accel: set accelerator and machine props earlier

2024-10-23 Thread Steven Sistare
On 10/21/2024 11:19 AM, Peter Xu wrote: On Thu, Oct 17, 2024 at 08:14:05AM -0700, Steve Sistare wrote: Make all global and compat properties available before the first objects are created. Set accelerator compatibility properties in configure_accelerators, when the accelerator is chosen, and ca

cpr-transfer with caveats

2024-10-25 Thread Steven Sistare
Hi Peter, are you OK if we proceed with cpr-transfer as is, without the precreate phase? Here are the problems that motivated it: * migration test wants to enable migration events on the dest. fix: enable on dest qemu using -global. only for the test. * migration test needs to fetch the dyna

Re: [PATCH V2 13/13] migration: cpr-transfer mode

2024-10-25 Thread Steven Sistare
On 10/25/2024 9:55 AM, Peter Xu wrote: On Thu, Oct 24, 2024 at 05:12:05PM -0400, Steven Sistare wrote: On 10/10/2024 5:23 PM, Peter Xu wrote: On Thu, Oct 10, 2024 at 04:06:13PM -0400, Steven Sistare wrote: vhost requires us to stop the vm early: qmp_migrate stop vm

Re: [PATCH V2 05/13] physmem: preserve ram blocks for cpr

2024-10-31 Thread Steven Sistare
On 10/8/2024 5:32 PM, Peter Xu wrote: On Tue, Oct 08, 2024 at 05:05:01PM -0400, Steven Sistare wrote: On 10/8/2024 12:26 PM, Peter Xu wrote: On Tue, Oct 08, 2024 at 11:17:46AM -0400, Steven Sistare wrote: On 10/7/2024 12:28 PM, Peter Xu wrote: On Mon, Oct 07, 2024 at 11:49:25AM -0400, Peter

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-06 Thread Steven Sistare
On 11/6/2024 3:41 PM, Peter Xu wrote: On Wed, Nov 06, 2024 at 03:12:20PM -0500, Steven Sistare wrote: On 11/4/2024 4:36 PM, David Hildenbrand wrote: On 04.11.24 21:56, Steven Sistare wrote: On 11/4/2024 3:15 PM, David Hildenbrand wrote: On 04.11.24 20:51, David Hildenbrand wrote: On

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-06 Thread Steven Sistare
On 11/4/2024 4:36 PM, David Hildenbrand wrote: On 04.11.24 21:56, Steven Sistare wrote: On 11/4/2024 3:15 PM, David Hildenbrand wrote: On 04.11.24 20:51, David Hildenbrand wrote: On 04.11.24 18:38, Steven Sistare wrote: On 11/4/2024 5:39 AM, David Hildenbrand wrote: On 01.11.24 14:47

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-07 Thread Steven Sistare
On 11/7/2024 11:26 AM, David Hildenbrand wrote: On 07.11.24 17:02, Steven Sistare wrote: On 11/7/2024 8:23 AM, David Hildenbrand wrote: On 06.11.24 21:12, Steven Sistare wrote: On 11/4/2024 4:36 PM, David Hildenbrand wrote: On 04.11.24 21:56, Steven Sistare wrote: On 11/4/2024 3:15 PM

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-07 Thread Steven Sistare
On 11/7/2024 11:19 AM, David Hildenbrand wrote: On 07.11.24 15:04, Steven Sistare wrote: On 11/7/2024 8:05 AM, David Hildenbrand wrote: [...] Do you plan to submit the part of your "tmp" patch that refactors shm_backend_memory_alloc and defines qemu_shm_alloc?  If you want, I could

Re: cpr-transfer with caveats

2024-10-25 Thread Steven Sistare
On 10/25/2024 11:47 AM, Peter Xu wrote: On Fri, Oct 25, 2024 at 11:01:27AM -0400, Steven Sistare wrote: Hi Peter, are you OK if we proceed with cpr-transfer as is, without the precreate phase? Here are the problems that motivated it: * migration test wants to enable migration events on the

Re: cpr-transfer with caveats

2024-10-25 Thread Steven Sistare
On 10/25/2024 11:54 AM, Daniel P. Berrangé wrote: On Fri, Oct 25, 2024 at 11:01:27AM -0400, Steven Sistare wrote: Hi Peter, are you OK if we proceed with cpr-transfer as is, without the precreate phase? Here are the problems that motivated it: * migration test wants to enable migration events

Re: [RFC V1 00/14] precreate phase

2024-10-17 Thread Steven Sistare
On 10/17/2024 11:14 AM, Steve Sistare wrote: Define a new qemu initialization phase called 'precreate' which occurs before most backends or devices have been created. The only exception is monitor and qtest devices and their associated chardevs. QEMU runs in the main loop during this phase. Mo

Re: [RFC V1 02/14] accel: accel preinit function

2024-10-17 Thread Steven Sistare
cc Xen, whpx, and nvmm accelerator maintainers for this accelerator-specific patch. The cover letter for this series is here: https://lore.kernel.org/qemu-devel/1729178055-207271-1-git-send-email-steven.sist...@oracle.com - Steve On 10/17/2024 11:14 AM, Steve Sistare wrote: Extract the firs

Re: [RFC V1 13/14] net: cleanup for precreate phase

2024-10-17 Thread Steven Sistare
cc jason. The cover letter for this series is here: https://lore.kernel.org/qemu-devel/1729178055-207271-1-git-send-email-steven.sist...@oracle.com - Steve On 10/17/2024 11:14 AM, Steve Sistare wrote: Guard against unconfigured state if cleanup is called early, such as during the precreate ph

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-07 Thread Steven Sistare
On 11/6/2024 4:21 PM, Peter Xu wrote: On Wed, Nov 06, 2024 at 03:59:23PM -0500, Steven Sistare wrote: On 11/6/2024 3:41 PM, Peter Xu wrote: On Wed, Nov 06, 2024 at 03:12:20PM -0500, Steven Sistare wrote: On 11/4/2024 4:36 PM, David Hildenbrand wrote: On 04.11.24 21:56, Steven Sistare wrote

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-07 Thread Steven Sistare
On 11/7/2024 8:05 AM, David Hildenbrand wrote: On 06.11.24 21:59, Steven Sistare wrote: On 11/6/2024 3:41 PM, Peter Xu wrote: On Wed, Nov 06, 2024 at 03:12:20PM -0500, Steven Sistare wrote: On 11/4/2024 4:36 PM, David Hildenbrand wrote: On 04.11.24 21:56, Steven Sistare wrote: On 11/4/2024

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-07 Thread Steven Sistare
On 11/7/2024 8:23 AM, David Hildenbrand wrote: On 06.11.24 21:12, Steven Sistare wrote: On 11/4/2024 4:36 PM, David Hildenbrand wrote: On 04.11.24 21:56, Steven Sistare wrote: On 11/4/2024 3:15 PM, David Hildenbrand wrote: On 04.11.24 20:51, David Hildenbrand wrote: On 04.11.24 18:38

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-08 Thread Steven Sistare
On 11/8/2024 6:31 AM, David Hildenbrand wrote: On 07.11.24 17:40, Steven Sistare wrote: On 11/7/2024 11:26 AM, David Hildenbrand wrote: On 07.11.24 17:02, Steven Sistare wrote: On 11/7/2024 8:23 AM, David Hildenbrand wrote: On 06.11.24 21:12, Steven Sistare wrote: On 11/4/2024 4:36 PM

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-08 Thread Steven Sistare
On 11/8/2024 8:43 AM, Peter Xu wrote: On Fri, Nov 08, 2024 at 12:31:45PM +0100, David Hildenbrand wrote: On 07.11.24 17:40, Steven Sistare wrote: On 11/7/2024 11:26 AM, David Hildenbrand wrote: On 07.11.24 17:02, Steven Sistare wrote: On 11/7/2024 8:23 AM, David Hildenbrand wrote: On

Re: [PATCH V3 11/16] migration: cpr-transfer mode

2024-11-20 Thread Steven Sistare
On 11/19/2024 3:16 PM, Peter Xu wrote: On Tue, Nov 19, 2024 at 02:50:40PM -0500, Steven Sistare wrote: On 11/14/2024 2:04 PM, Peter Xu wrote: On Thu, Nov 14, 2024 at 01:36:00PM -0500, Steven Sistare wrote: On 11/13/2024 4:58 PM, Peter Xu wrote: On Fri, Nov 01, 2024 at 06:47:50AM -0700, Steve

Re: [PATCH V3 11/16] migration: cpr-transfer mode

2024-11-19 Thread Steven Sistare
On 11/19/2024 3:51 PM, Peter Xu wrote: On Tue, Nov 19, 2024 at 03:32:55PM -0500, Steven Sistare wrote: This begs the question, should we allow channels to be specified in hmp migrate commands and for -incoming, in a very simple way? Like with a prefix naming the channel. And eliminate the

Re: [PATCH V3 11/16] migration: cpr-transfer mode

2024-11-19 Thread Steven Sistare
On 11/19/2024 4:48 PM, Peter Xu wrote: On Tue, Nov 19, 2024 at 04:41:07PM -0500, Steven Sistare wrote: On 11/19/2024 4:29 PM, Peter Xu wrote: On Tue, Nov 19, 2024 at 04:03:08PM -0500, Steven Sistare wrote: On 11/19/2024 3:51 PM, Peter Xu wrote: On Tue, Nov 19, 2024 at 03:32:55PM -0500

Re: [PATCH V3 11/16] migration: cpr-transfer mode

2024-11-19 Thread Steven Sistare
On 11/14/2024 2:04 PM, Peter Xu wrote: On Thu, Nov 14, 2024 at 01:36:00PM -0500, Steven Sistare wrote: On 11/13/2024 4:58 PM, Peter Xu wrote: On Fri, Nov 01, 2024 at 06:47:50AM -0700, Steve Sistare wrote: Add the cpr-transfer migration mode. Usage: qemu-system-$arch -machine anon-alloc

Re: [PATCH V3 11/16] migration: cpr-transfer mode

2024-11-19 Thread Steven Sistare
On 11/19/2024 4:29 PM, Peter Xu wrote: On Tue, Nov 19, 2024 at 04:03:08PM -0500, Steven Sistare wrote: On 11/19/2024 3:51 PM, Peter Xu wrote: On Tue, Nov 19, 2024 at 03:32:55PM -0500, Steven Sistare wrote: This begs the question, should we allow channels to be specified in hmp migrate

Re: [PATCH V3 11/16] migration: cpr-transfer mode

2024-11-20 Thread Steven Sistare
On 11/20/2024 4:38 AM, Daniel P. Berrangé wrote: On Tue, Nov 19, 2024 at 03:32:55PM -0500, Steven Sistare wrote: On 11/19/2024 3:16 PM, Peter Xu wrote: On Tue, Nov 19, 2024 at 02:50:40PM -0500, Steven Sistare wrote: On 11/14/2024 2:04 PM, Peter Xu wrote: On Thu, Nov 14, 2024 at 01:36:00PM

Re: [PATCH V3 01/16] machine: anon-alloc option

2024-11-08 Thread Steven Sistare
On 11/8/2024 9:20 AM, David Hildenbrand wrote: On 08.11.24 14:56, Steven Sistare wrote: On 11/8/2024 6:31 AM, David Hildenbrand wrote: On 07.11.24 17:40, Steven Sistare wrote: On 11/7/2024 11:26 AM, David Hildenbrand wrote: On 07.11.24 17:02, Steven Sistare wrote: On 11/7/2024 8:23 AM

Re: [PATCH V3 11/16] migration: cpr-transfer mode

2024-11-14 Thread Steven Sistare
On 11/13/2024 4:58 PM, Peter Xu wrote: On Fri, Nov 01, 2024 at 06:47:50AM -0700, Steve Sistare wrote: Add the cpr-transfer migration mode. Usage: qemu-system-$arch -machine anon-alloc=memfd ... start new QEMU with "-incoming -cpr-uri " Issue commands to old QEMU: migrate_set_para

Re: [PATCH V3 13/16] tests/qtest: defer connection

2024-11-14 Thread Steven Sistare
On 11/13/2024 5:36 PM, Fabiano Rosas wrote: Steve Sistare writes: Add an option to defer making the connecting to the monitor and qtest sockets when calling qtest_init_with_env. The client makes the connection later by calling qtest_connect_deferred and qtest_qmp_handshake. Signed-off-by: St

Re: [PATCH V3 13/16] tests/qtest: defer connection

2024-11-14 Thread Steven Sistare
On 11/13/2024 5:53 PM, Peter Xu wrote: On Fri, Nov 01, 2024 at 06:47:52AM -0700, Steve Sistare wrote: +void qtest_connect_deferred(QTestState *s) +{ +g_autofree gchar *socket_path = NULL; +g_autofree gchar *qmp_socket_path = NULL; + +socket_path = g_strdup_printf("%s/qtest-%d.sock",

Re: [PATCH V3 16/16] migration: cpr-transfer documentation

2024-11-14 Thread Steven Sistare
On 11/13/2024 5:02 PM, Peter Xu wrote: On Fri, Nov 01, 2024 at 06:47:55AM -0700, Steve Sistare wrote: +Caveats +^^^ + +cpr-transfer mode may not be used with postcopy, background-snapshot, +or COLO. + +memory-backend-epc and memory-backend-ram are not supported. Just to double check: now t

Re: [PATCH V3 10/16] migration: split qmp_migrate

2024-11-14 Thread Steven Sistare
On 11/13/2024 4:11 PM, Peter Xu wrote: On Fri, Nov 01, 2024 at 06:47:49AM -0700, Steve Sistare wrote: Split qmp_migrate into start and finish functions. Finish will be called asynchronously in a subsequent patch, but for now, call it immediately. No functional change. Signed-off-by: Steve Sis

Re: [PATCH V3 05/16] migration: SCM_RIGHTS for QEMUFile

2024-11-14 Thread Steven Sistare
On 11/13/2024 3:54 PM, Peter Xu wrote: On Fri, Nov 01, 2024 at 06:47:44AM -0700, Steve Sistare wrote: Define functions to put/get file descriptors to/from a QEMUFile, for qio channels that support SCM_RIGHTS. Maintain ordering such that put(A), put(fd), put(B) followed by get(A), get(fd),

Re: [PATCH V4 04/19] machine: aux-ram-share option

2024-12-05 Thread Steven Sistare
On 12/5/2024 3:25 AM, Markus Armbruster wrote: Steve Sistare writes: Allocate auxilliary guest RAM as an anonymous file that is shareable with an external process. This option applies to memory allocated as a side effect of creating various devices. It does not apply to memory-backend-objects

Re: [PATCH V4 04/19] machine: aux-ram-share option

2024-12-05 Thread Steven Sistare
On 12/5/2024 7:19 AM, Markus Armbruster wrote: Markus Armbruster writes: Steve Sistare writes: Allocate auxilliary guest RAM as an anonymous file that is shareable with an external process. This option applies to memory allocated as a side effect of creating various devices. It does not ap

Re: [PATCH V4 14/19] migration: cpr-transfer mode

2024-12-04 Thread Steven Sistare
On 12/2/2024 8:20 AM, Steve Sistare wrote: [...] + +/* + * If qmp_migrate_finish has not been called, then there is no path that + * will complete the cancellation. Do it now. + */ +if (setup && !s->to_dst_file) { +migrate_set_state(&s->state, s->state, MIGRATION_STAT

Re: [PATCH V4 10/19] migration: cpr channel

2024-12-05 Thread Steven Sistare
On 12/5/2024 10:37 AM, Markus Armbruster wrote: Steve Sistare writes: Add the 'cpr' channel type, and stash the incoming cpr channel for use in a subsequent patch. Signed-off-by: Steve Sistare [...] diff --git a/qapi/migration.json b/qapi/migration.json index a605dc2..a26960b 100644 ---

Re: [PATCH V5 02/23] physmem: qemu_ram_alloc_from_fd extensions

2025-01-02 Thread Steven Sistare
On 1/2/2025 2:48 PM, Peter Xu wrote: On Thu, Jan 02, 2025 at 01:36:01PM -0500, Steven Sistare wrote: On 12/24/2024 12:18 PM, Peter Xu wrote: On Tue, Dec 24, 2024 at 08:16:47AM -0800, Steve Sistare wrote: Extend qemu_ram_alloc_from_fd to support resizable ram, and define qemu_ram_resize_cb to

Re: [PATCH] physmem: fix qemu_ram_alloc_from_fd size calculation

2025-01-02 Thread Steven Sistare
On 1/2/2025 4:14 PM, Peter Xu wrote: On Thu, Jan 02, 2025 at 12:34:50PM -0800, Steve Sistare wrote: qemu_ram_alloc_from_fd allocates space if file_size == 0. If non-zero, it uses the existing space and verifies it is large enough, but the verification was broken when the offset parameter was in

Re: [PATCH V2] physmem: fix qemu_ram_alloc_from_fd size calculation

2025-01-07 Thread Steven Sistare
On 1/7/2025 5:01 AM, David Hildenbrand wrote: On 02.01.25 22:32, Steve Sistare wrote: qemu_ram_alloc_from_fd allocates space if file_size == 0.  If non-zero, it uses the existing space and verifies it is large enough, but the verification was broken when the offset parameter was introduced.  As

Re: [PATCH V5 15/23] migration: cpr-transfer mode

2025-01-07 Thread Steven Sistare
On 1/7/2025 7:05 AM, Markus Armbruster wrote: Steve Sistare writes: Add the cpr-transfer migration mode, which allows the user to transfer a guest to a new QEMU instance on the same host with minimal guest pause time, by preserving guest RAM in place, albeit with new virtual addresses in new Q

Re: [PATCH V1 05/26] vfio/container: preserve descriptors

2025-02-03 Thread Steven Sistare
On 2/3/2025 12:48 PM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: At vfio creation time, save the value of vfio container, group, and device descriptors in CPR state.  On qemu restart, vfio_realize() finds and uses the saved descriptors, and remembers the reused status for sub

Re: [PATCH V1 04/26] vfio/container: register container for cpr

2025-02-03 Thread Steven Sistare
On 2/3/2025 12:01 PM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Register a legacy container for cpr-transfer.  Add a blocker if the kernel does not support VFIO_UPDATE_VADDR or VFIO_UNMAP_ALL. This is mostly boiler plate.  The fields to to saved and restored are added in su

Re: [PATCH V1 06/26] vfio/container: preserve DMA mappings

2025-02-03 Thread Steven Sistare
On 2/3/2025 1:25 PM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Preserve DMA mappings during cpr-transfer. In the container pre_save handler, suspend the use of virtual addresses in DMA mappings with VFIO_DMA_UNMAP_FLAG_VADDR, because guest RAM will be remapped at a differen

Re: [PATCH] MAINTAINER: Add a maintainer for CPR

2025-02-04 Thread Steven Sistare
On 2/4/2025 10:02 AM, Philippe Mathieu-Daudé wrote: On 4/2/25 14:29, Paolo Bonzini wrote: On 2/4/25 09:28, Cédric Le Goater wrote: The CPR feature was added in QEMU 9.0 and it lacks a maintainer. Propose the main contributor to become one. Why can't changes go through the migration tree?  The

Re: [PATCH V1 10/26] vfio-pci: refactor for cpr

2025-02-04 Thread Steven Sistare
On 2/4/2025 9:39 AM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Refactor vector use into a helper vfio_vector_init. Add vfio_notifier_init and vfio_notifier_cleanup for named notifiers, and pass additional arguments to vfio_remove_kvm_msi_virq. All for use by CPR in a subseq

Re: [PATCH V1 11/26] vfio-pci: skip reset during cpr

2025-02-04 Thread Steven Sistare
On 2/4/2025 9:56 AM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Do not reset a vfio-pci device during CPR, and do not complain if the kernel's PCI config space changes for non-emulated bits between the vmstate save and load, which can happen due to ongoing interrupt activity.

Re: [PATCH V1 08/26] pci: skip reset during cpr

2025-02-04 Thread Steven Sistare
On 2/4/2025 9:14 AM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Do not reset a vfio-pci device during CPR. Signed-off-by: Steve Sistare ---   hw/pci/pci.c | 13 +   1 file changed, 13 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2afa423..16b4f71

Re: [PATCH V1 07/26] vfio/container: recover from unmap-all-vaddr failure

2025-02-04 Thread Steven Sistare
On 2/4/2025 9:10 AM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: If there are multiple containers and unmap-all fails for some container, we need to remap vaddr for the other containers for which unmap-all succeeded. Recover by walking all address ranges of all containers to r

Re: [PULL 17/42] migration: cpr-transfer mode

2025-02-04 Thread Steven Sistare
On 2/4/2025 11:26 AM, Peter Xu wrote: On Tue, Feb 04, 2025 at 01:40:34PM +, Peter Maydell wrote: On Wed, 29 Jan 2025 at 16:11, Fabiano Rosas wrote: From: Steve Sistare Add the cpr-transfer migration mode, which allows the user to transfer a guest to a new QEMU instance on the same host

Re: [PATCH] MAINTAINER: Add a maintainer for CPR

2025-02-04 Thread Steven Sistare
Hi Cedric, CPR is a mode of live migration, integrated so closely that it makes more sense for the migration maintainers to maintain it, and consult me if/when necessary. "migration" appears in 4 of the 5 paths you list below. - Steve On 2/4/2025 3:28 AM, Cédric Le Goater wrote: The CPR featur

Re: [PATCH V1 18/26] vfio/iommufd: define iommufd_cdev_make_hwpt

2025-02-04 Thread Steven Sistare
On 2/4/2025 11:22 AM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Refactor and define iommufd_cdev_make_hwpt, to be called by CPR in a a later patch.  No functional change. Signed-off-by: Steve Sistare ---   hw/vfio/iommufd.c | 69 +---

Re: [PATCH V1 16/26] vfio: return mr from vfio_get_xlat_addr

2025-02-04 Thread Steven Sistare
On 2/4/2025 10:47 AM, Cédric Le Goater wrote: + John (for vfio-user) On 1/29/25 15:43, Steve Sistare wrote: Return the memory region that the translated address is found in, for use in a subsequent patch.  No functional change. Keeping a reference on this memory region could be risky. What fo

Re: [PATCH] MAINTAINER: Add a maintainer for CPR

2025-02-04 Thread Steven Sistare
On 2/4/2025 8:42 AM, Cédric Le Goater wrote: On 2/4/25 14:31, Steven Sistare wrote: Hi Cedric, CPR is a mode of live migration, integrated so closely that it makes more sense for the migration maintainers to maintain it, and consult me if/when necessary.  "migration" appears in 4 of t

Re: [PATCH] migration: use parameters.mode in cpr_state_save

2025-02-07 Thread Steven Sistare
On 2/5/2025 4:52 PM, Steven Sistare wrote: On 2/5/2025 4:28 PM, Peter Xu wrote: On Wed, Feb 05, 2025 at 12:54:01PM -0800, Steve Sistare wrote: qmp_migrate guarantees that cpr_channel is not null for MIG_MODE_CPR_TRANSFER when cpr_state_save is called: qmp_migrate() if (s

Re: [PATCH V1 12/26] vfio-pci: preserve MSI

2025-02-06 Thread Steven Sistare
On 2/5/2025 11:48 AM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Save the MSI message area as part of vfio-pci vmstate, and preserve the interrupt and notifier eventfd's.  migrate_incoming loads the MSI data, then the vfio-pci post_load handler finds the eventfds in CPR state

Re: [PATCH V1 13/26] vfio-pci: preserve INTx

2025-02-06 Thread Steven Sistare
On 2/5/2025 12:13 PM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Preserve vfio INTx state across cpr-transfer.  Preserve VFIOINTx fields as follows:    pin : Recover this from the vfio config in kernel space    interrupt : Preserve its eventfd descriptor across exec.    unmas

Re: [PATCH V1 02/26] migration: lower handler priority

2025-02-06 Thread Steven Sistare
On 2/3/2025 11:58 AM, Peter Xu wrote: On Wed, Jan 29, 2025 at 06:42:58AM -0800, Steve Sistare wrote: Define a vmstate priority that is lower than the default, so its handlers run after all default priority handlers. Since 0 is no longer the default priority, translate an uninitialized priority

Re: [PATCH] migration: use parameters.mode in cpr_state_save

2025-02-05 Thread Steven Sistare
On 2/5/2025 4:28 PM, Peter Xu wrote: On Wed, Feb 05, 2025 at 12:54:01PM -0800, Steve Sistare wrote: qmp_migrate guarantees that cpr_channel is not null for MIG_MODE_CPR_TRANSFER when cpr_state_save is called: qmp_migrate() if (s->parameters.mode == MIG_MODE_CPR_TRANSFER && !cpr_ch

Re: [PATCH V1 19/26] vfio/iommufd: use IOMMU_IOAS_MAP_FILE

2025-02-05 Thread Steven Sistare
On 2/5/2025 12:23 PM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Use IOMMU_IOAS_MAP_FILE when the mapped region is backed by a file. Such a mapping can be preserved without modification during CPR, because it depends on the file's address space, which does not change, rather

Re: [PATCH V1 22/26] vfio/iommufd: invariant device name

2025-02-05 Thread Steven Sistare
On 2/5/2025 12:42 PM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: cpr-transfer will use the device name as a key to find the value of the device descriptor in new QEMU.  However, if the descriptor number is specified by a command-line fd parameter, then vfio_device_get_name cr

Re: [PATCH V1 21/26] iommufd: change process ioctl

2025-02-05 Thread Steven Sistare
On 2/5/2025 12:34 PM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Define the change process ioctl Signed-off-by: Steve Sistare ---   backends/iommufd.c   | 20   backends/trace-events    |  1 +   include/system/iommufd.h |  2 ++   3 files changed, 2

Re: [PATCH V1 23/26] vfio/iommufd: register container for cpr

2025-02-05 Thread Steven Sistare
On 2/5/2025 12:45 PM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Register a vfio iommufd container for CPR.  Add a blocker if the kernel does not support IOMMU_IOAS_CHANGE_PROCESS. This is mostly boiler plate.  The fields to to saved and restored are added in subsequent patc

Re: [PATCH V1 20/26] vfio/iommufd: export iommufd_cdev_get_info_iova_range

2025-02-05 Thread Steven Sistare
On 2/5/2025 12:33 PM, Cédric Le Goater wrote: On 1/29/25 15:43, Steve Sistare wrote: Export iommufd_cdev_get_info_iova_range for use by CPR. why does CPR need access to the IOVA ranges ? This is explained in the commit message of a subsequent patch, "vfio/iommufd: reconstruct device" - Stev

Re: [PATCH V4 14/19] migration: cpr-transfer mode

2024-12-11 Thread Steven Sistare
On 12/10/2024 7:26 AM, Markus Armbruster wrote: Steve Sistare writes: Add the cpr-transfer migration mode. Usage: qemu-system-$arch -machine aux-ram-share=on ... start new QEMU with "-incoming -incoming " Issue commands to old QEMU: migrate_set_parameter mode cpr-transfer

Re: [PATCH V4 09/19] migration: incoming channel

2024-12-11 Thread Steven Sistare
On 12/9/2024 7:12 AM, Markus Armbruster wrote: Steven Sistare writes: On 12/5/2024 10:23 AM, Markus Armbruster wrote: Steve Sistare writes: Extend the -incoming option to allow an @MigrationChannel to be specified. This allows channels other than 'main' to be described on the co

Re: [PATCH V4 07/19] hostmem-memfd: preserve for cpr

2024-12-18 Thread Steven Sistare
Hi Peter, can we upgrade your Acked-by to an RB? You gave RB to the similar patch "hostmem-shm: preserve for cpr" - Steve On 12/2/2024 8:19 AM, Steve Sistare wrote: Preserve memory-backend-memfd memory objects during cpr-transfer. Signed-off-by: Steve Sistare Acked-by: Peter Xu --- backen

<    1   2   3   4   5   6   7   8   >