Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-05 Thread Steven Sistare
On 12/5/2023 11:50 AM, Peter Xu wrote: > On Mon, Dec 04, 2023 at 05:23:57PM -0500, Steven Sistare wrote: >> The V6 code does not pass a state to vm_start, and knowledge of >> vm_was_suspended >> is confined to the global_state and cpus functions. IMO this is a more >> modular >> and robust solut

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-05 Thread Steven Sistare
On 12/5/2023 11:52 AM, Fabiano Rosas wrote: > Peter Xu writes: > >> On Tue, Dec 05, 2023 at 09:44:12AM -0300, Fabiano Rosas wrote: >>> Peter Xu writes: >>> On Mon, Dec 04, 2023 at 06:09:16PM -0300, Fabiano Rosas wrote: > Right, I got your point. I just think we could avoid designing thi

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-05 Thread Fabiano Rosas
Peter Xu writes: > On Tue, Dec 05, 2023 at 09:44:12AM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Mon, Dec 04, 2023 at 06:09:16PM -0300, Fabiano Rosas wrote: >> >> Right, I got your point. I just think we could avoid designing this new >> >> string format by creating new fields w

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-05 Thread Peter Xu
On Mon, Dec 04, 2023 at 05:23:57PM -0500, Steven Sistare wrote: > The V6 code does not pass a state to vm_start, and knowledge of > vm_was_suspended > is confined to the global_state and cpus functions. IMO this is a more > modular > and robust solution, as multiple sites may call vm_start(), an

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-05 Thread Peter Xu
On Tue, Dec 05, 2023 at 09:44:12AM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Mon, Dec 04, 2023 at 06:09:16PM -0300, Fabiano Rosas wrote: > >> Right, I got your point. I just think we could avoid designing this new > >> string format by creating new fields with the extra space: > >>

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-05 Thread Steven Sistare
On 12/5/2023 7:44 AM, Fabiano Rosas wrote: > Peter Xu writes: > >> On Mon, Dec 04, 2023 at 06:09:16PM -0300, Fabiano Rosas wrote: >>> Right, I got your point. I just think we could avoid designing this new >>> string format by creating new fields with the extra space: >>> >>> typedef struct QEMU_

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-05 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Dec 04, 2023 at 06:09:16PM -0300, Fabiano Rosas wrote: >> Right, I got your point. I just think we could avoid designing this new >> string format by creating new fields with the extra space: >> >> typedef struct QEMU_PACKED { >> uint32_t size; >> uint8_t runst

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-04 Thread Steven Sistare
On 12/4/2023 12:24 PM, Peter Xu wrote: > On Fri, Dec 01, 2023 at 11:23:33AM -0500, Steven Sistare wrote: @@ -109,6 +117,7 @@ static int global_state_post_load(void *opaque, int version_id) return -EINVAL; } s->state = r; +vm_set_suspended(s->vm_

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-04 Thread Peter Xu
On Mon, Dec 04, 2023 at 06:09:16PM -0300, Fabiano Rosas wrote: > Right, I got your point. I just think we could avoid designing this new > string format by creating new fields with the extra space: > > typedef struct QEMU_PACKED { > uint32_t size; > uint8_t runstate[50]; > uint8_t unus

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-04 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Dec 04, 2023 at 04:31:56PM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Fri, Dec 01, 2023 at 11:23:33AM -0500, Steven Sistare wrote: >> >> >> @@ -109,6 +117,7 @@ static int global_state_post_load(void *opaque, >> >> >> int version_id) >> >> >>

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-04 Thread Peter Xu
On Mon, Dec 04, 2023 at 04:31:56PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Fri, Dec 01, 2023 at 11:23:33AM -0500, Steven Sistare wrote: > >> >> @@ -109,6 +117,7 @@ static int global_state_post_load(void *opaque, int > >> >> version_id) > >> >> return -EINVAL; > >> >>

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-04 Thread Fabiano Rosas
Peter Xu writes: > On Fri, Dec 01, 2023 at 11:23:33AM -0500, Steven Sistare wrote: >> >> @@ -109,6 +117,7 @@ static int global_state_post_load(void *opaque, int >> >> version_id) >> >> return -EINVAL; >> >> } >> >> s->state = r; >> >> +vm_set_suspended(s->vm_was_suspended

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-04 Thread Peter Xu
On Fri, Dec 01, 2023 at 11:23:33AM -0500, Steven Sistare wrote: > >> @@ -109,6 +117,7 @@ static int global_state_post_load(void *opaque, int > >> version_id) > >> return -EINVAL; > >> } > >> s->state = r; > >> +vm_set_suspended(s->vm_was_suspended || r == RUN_STATE_SUSPENDED

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-12-01 Thread Steven Sistare
On 11/30/2023 6:06 PM, Peter Xu wrote: > On Thu, Nov 30, 2023 at 01:37:18PM -0800, Steve Sistare wrote: >> If the outgoing machine was previously suspended, propagate that to the >> incoming side via global_state, so a subsequent vm_start restores the >> suspended state. To maintain backward and f

Re: [PATCH V6 05/14] migration: propagate suspended runstate

2023-11-30 Thread Peter Xu
On Thu, Nov 30, 2023 at 01:37:18PM -0800, Steve Sistare wrote: > If the outgoing machine was previously suspended, propagate that to the > incoming side via global_state, so a subsequent vm_start restores the > suspended state. To maintain backward and forward compatibility, define > the new field

[PATCH V6 05/14] migration: propagate suspended runstate

2023-11-30 Thread Steve Sistare
If the outgoing machine was previously suspended, propagate that to the incoming side via global_state, so a subsequent vm_start restores the suspended state. To maintain backward and forward compatibility, define the new field in a zero'd hole in the GlobalState struct. Signed-off-by: Steve Sist