qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 14/17] add new RanState RAN_STATE_FLIPPING_MIGRA


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 14/17] add new RanState RAN_STATE_FLIPPING_MIGRATE
Date: Thu, 24 Oct 2013 15:13:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 22/10/2013 04:25, Lei Li ha scritto:
> Introduce new RanState RAN_STATE_FLIPPING_MIGRATE and
> add it to runstate_needs_reset().

I am not sure about the name; for one thing, the new state would apply
also to postcopy migration.

But the code looks ok.

Paolo

> Signed-off-by: Lei Li <address@hidden>
> ---
>  qapi-schema.json |   11 +++++++----
>  vl.c             |   12 +++++++++++-
>  2 files changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 523a5b2..8178d0c 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -176,12 +176,15 @@
>  # @watchdog: the watchdog action is configured to pause and has been 
> triggered
>  #
>  # @guest-panicked: guest has been panicked as a result of guest OS panic
> +#
> +# @flipping-migrate: guest is paused to start unix_page_flipping migration
> +# process
>  ##
>  { 'enum': 'RunState',
> -  'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
> -            'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
> -            'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
> -            'guest-panicked' ] }
> +  'data': [ 'debug', 'flipping-migrate', 'inmigrate', 'internal-error',
> +            'io-error', 'paused', 'postmigrate', 'prelaunch', 
> 'finish-migrate',
> +            'restore-vm', 'running', 'save-vm', 'shutdown', 'suspended',
> +            'watchdog', 'guest-panicked' ] }
>  
>  ##
>  # @SnapshotInfo
> diff --git a/vl.c b/vl.c
> index b42ac67..fcdf981 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -601,6 +601,7 @@ static const RunStateTransition 
> runstate_transitions_def[] = {
>  
>      { RUN_STATE_PAUSED, RUN_STATE_RUNNING },
>      { RUN_STATE_PAUSED, RUN_STATE_FINISH_MIGRATE },
> +    { RUN_STATE_PAUSED, RUN_STATE_FLIPPING_MIGRATE },
>  
>      { RUN_STATE_POSTMIGRATE, RUN_STATE_RUNNING },
>      { RUN_STATE_POSTMIGRATE, RUN_STATE_FINISH_MIGRATE },
> @@ -624,23 +625,31 @@ static const RunStateTransition 
> runstate_transitions_def[] = {
>      { RUN_STATE_RUNNING, RUN_STATE_SHUTDOWN },
>      { RUN_STATE_RUNNING, RUN_STATE_WATCHDOG },
>      { RUN_STATE_RUNNING, RUN_STATE_GUEST_PANICKED },
> +    { RUN_STATE_RUNNING, RUN_STATE_FLIPPING_MIGRATE },
>  
>      { RUN_STATE_SAVE_VM, RUN_STATE_RUNNING },
>  
>      { RUN_STATE_SHUTDOWN, RUN_STATE_PAUSED },
>      { RUN_STATE_SHUTDOWN, RUN_STATE_FINISH_MIGRATE },
> +    { RUN_STATE_SHUTDOWN, RUN_STATE_FLIPPING_MIGRATE },
>  
>      { RUN_STATE_DEBUG, RUN_STATE_SUSPENDED },
>      { RUN_STATE_RUNNING, RUN_STATE_SUSPENDED },
>      { RUN_STATE_SUSPENDED, RUN_STATE_RUNNING },
>      { RUN_STATE_SUSPENDED, RUN_STATE_FINISH_MIGRATE },
> +    { RUN_STATE_SUSPENDED, RUN_STATE_FLIPPING_MIGRATE },
>  
>      { RUN_STATE_WATCHDOG, RUN_STATE_RUNNING },
>      { RUN_STATE_WATCHDOG, RUN_STATE_FINISH_MIGRATE },
> +    { RUN_STATE_WATCHDOG, RUN_STATE_FLIPPING_MIGRATE },
>  
>      { RUN_STATE_GUEST_PANICKED, RUN_STATE_PAUSED },
>      { RUN_STATE_GUEST_PANICKED, RUN_STATE_FINISH_MIGRATE },
>      { RUN_STATE_GUEST_PANICKED, RUN_STATE_DEBUG },
> +    { RUN_STATE_GUEST_PANICKED, RUN_STATE_FLIPPING_MIGRATE },
> +
> +    { RUN_STATE_FLIPPING_MIGRATE, RUN_STATE_RUNNING },
> +    { RUN_STATE_FLIPPING_MIGRATE, RUN_STATE_POSTMIGRATE },
>  
>      { RUN_STATE_MAX, RUN_STATE_MAX },
>  };
> @@ -687,7 +696,8 @@ bool runstate_needs_reset(void)
>  {
>      return runstate_check(RUN_STATE_INTERNAL_ERROR) ||
>          runstate_check(RUN_STATE_SHUTDOWN) ||
> -        runstate_check(RUN_STATE_GUEST_PANICKED);
> +        runstate_check(RUN_STATE_GUEST_PANICKED) ||
> +        runstate_check(RUN_STATE_FLIPPING_MIGRATE);
>  }
>  
>  StatusInfo *qmp_query_status(Error **errp)
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]