diff mbox series

[1/3] migration/migration.c: Add missed default error handler for migration state

Message ID 20211231055935.1878503-2-chen.zhang@intel.com (mailing list archive)
State New, archived
Headers show
Series Some minor fixes for migration states | expand

Commit Message

Zhang Chen Dec. 31, 2021, 5:59 a.m. UTC
In the migration_completion() no other status is expected, for
example MIGRATION_STATUS_CANCELLING, MIGRATION_STATUS_CANCELLED, etc.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dr. David Alan Gilbert Jan. 19, 2022, 5:52 p.m. UTC | #1
* Zhang Chen (chen.zhang@intel.com) wrote:
> In the migration_completion() no other status is expected, for
> example MIGRATION_STATUS_CANCELLING, MIGRATION_STATUS_CANCELLED, etc.
> 
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>

I think you're right;

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

 however, did you actually see this trigger in a different state?

Dave
> ---
>  migration/migration.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/migration/migration.c b/migration/migration.c
> index 0652165610..2afa77da03 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -3205,7 +3205,7 @@ static void migration_completion(MigrationState *s)
>          qemu_mutex_unlock_iothread();
>  
>          trace_migration_completion_postcopy_end_after_complete();
> -    } else if (s->state == MIGRATION_STATUS_CANCELLING) {
> +    } else {
>          goto fail;
>      }
>  
> -- 
> 2.25.1
>
Zhang Chen Jan. 20, 2022, 2:55 p.m. UTC | #2
> -----Original Message-----
> From: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Sent: Thursday, January 20, 2022 1:52 AM
> To: Zhang, Chen <chen.zhang@intel.com>
> Cc: Juan Quintela <quintela@redhat.com>; qemu-dev <qemu-
> devel@nongnu.org>
> Subject: Re: [PATCH 1/3] migration/migration.c: Add missed default error
> handler for migration state
> 
> * Zhang Chen (chen.zhang@intel.com) wrote:
> > In the migration_completion() no other status is expected, for example
> > MIGRATION_STATUS_CANCELLING, MIGRATION_STATUS_CANCELLED, etc.
> >
> > Signed-off-by: Zhang Chen <chen.zhang@intel.com>
> 
> I think you're right;
> 
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> 
>  however, did you actually see this trigger in a different state?

No, I just read the code and found it.

Thanks
Chen

> 
> Dave
> > ---
> >  migration/migration.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/migration/migration.c b/migration/migration.c index
> > 0652165610..2afa77da03 100644
> > --- a/migration/migration.c
> > +++ b/migration/migration.c
> > @@ -3205,7 +3205,7 @@ static void migration_completion(MigrationState
> *s)
> >          qemu_mutex_unlock_iothread();
> >
> >          trace_migration_completion_postcopy_end_after_complete();
> > -    } else if (s->state == MIGRATION_STATUS_CANCELLING) {
> > +    } else {
> >          goto fail;
> >      }
> >
> > --
> > 2.25.1
> >
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Juan Quintela Jan. 26, 2022, 7:23 p.m. UTC | #3
Zhang Chen <chen.zhang@intel.com> wrote:
> In the migration_completion() no other status is expected, for
> example MIGRATION_STATUS_CANCELLING, MIGRATION_STATUS_CANCELLED, etc.
>
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

queued
diff mbox series

Patch

diff --git a/migration/migration.c b/migration/migration.c
index 0652165610..2afa77da03 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3205,7 +3205,7 @@  static void migration_completion(MigrationState *s)
         qemu_mutex_unlock_iothread();
 
         trace_migration_completion_postcopy_end_after_complete();
-    } else if (s->state == MIGRATION_STATUS_CANCELLING) {
+    } else {
         goto fail;
     }