All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Migration/colo.c: Fix upstream bugs when occur failover
@ 2019-02-26  5:34 Zhang Chen
  2019-02-26  5:34 ` [Qemu-devel] [PATCH 1/3] Migration/colo.c: Fix double close bug when occur COLO failover Zhang Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Zhang Chen @ 2019-02-26  5:34 UTC (permalink / raw)
  To: Li Zhijian, Zhang Chen, Dr. David Alan Gilbert, Juan Quintela,
	zhanghailiang, qemu-dev
  Cc: Zhang Chen

From: Zhang Chen <chen.zhang@intel.com>

Fix three bugs after COLO failover.


Zhang Chen (3):
  Migration/colo.c: Fix double close bug when occur COLO failover
  Migration/colo.c: Fix COLO failover status error
  Migration/colo.c: Make COLO node running after failover

 migration/colo.c      | 9 +++++----
 migration/migration.c | 3 +++
 2 files changed, 8 insertions(+), 4 deletions(-)

-- 
2.17.GIT

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

* [Qemu-devel] [PATCH 1/3] Migration/colo.c: Fix double close bug when occur COLO failover
  2019-02-26  5:34 [Qemu-devel] [PATCH 0/3] Migration/colo.c: Fix upstream bugs when occur failover Zhang Chen
@ 2019-02-26  5:34 ` Zhang Chen
  2019-02-26 10:36   ` Dr. David Alan Gilbert
  2019-02-26  5:34 ` [Qemu-devel] [PATCH 2/3] Migration/colo.c: Fix COLO failover status error Zhang Chen
  2019-02-26  5:34 ` [Qemu-devel] [PATCH 3/3] Migration/colo.c: Make COLO node running after failover Zhang Chen
  2 siblings, 1 reply; 10+ messages in thread
From: Zhang Chen @ 2019-02-26  5:34 UTC (permalink / raw)
  To: Li Zhijian, Zhang Chen, Dr. David Alan Gilbert, Juan Quintela,
	zhanghailiang, qemu-dev
  Cc: Zhang Chen

From: Zhang Chen <chen.zhang@intel.com>

In migration_incoming_state_destroy(void) will check the mis->to_src_file
to double close the mis->to_src_file when occur COLO failover.

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

diff --git a/migration/colo.c b/migration/colo.c
index 398b239d1c..a916dc178c 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -872,6 +872,7 @@ out:
     /* Must be called after failover BH is completed */
     if (mis->to_src_file) {
         qemu_fclose(mis->to_src_file);
+        mis->to_src_file = NULL;
     }
     migration_incoming_disable_colo();
 
-- 
2.17.GIT

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

* [Qemu-devel] [PATCH 2/3] Migration/colo.c: Fix COLO failover status error
  2019-02-26  5:34 [Qemu-devel] [PATCH 0/3] Migration/colo.c: Fix upstream bugs when occur failover Zhang Chen
  2019-02-26  5:34 ` [Qemu-devel] [PATCH 1/3] Migration/colo.c: Fix double close bug when occur COLO failover Zhang Chen
@ 2019-02-26  5:34 ` Zhang Chen
  2019-02-26 10:55   ` Dr. David Alan Gilbert
  2019-02-26  5:34 ` [Qemu-devel] [PATCH 3/3] Migration/colo.c: Make COLO node running after failover Zhang Chen
  2 siblings, 1 reply; 10+ messages in thread
From: Zhang Chen @ 2019-02-26  5:34 UTC (permalink / raw)
  To: Li Zhijian, Zhang Chen, Dr. David Alan Gilbert, Juan Quintela,
	zhanghailiang, qemu-dev
  Cc: Zhang Chen

From: Zhang Chen <chen.zhang@intel.com>

When finished COLO failover, the status is FAILOVER_STATUS_COMPLETED.
The origin codes misunderstand the FAILOVER_STATUS_REQUIRE.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
---
 migration/colo.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/migration/colo.c b/migration/colo.c
index a916dc178c..a13acac192 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -121,6 +121,7 @@ static void secondary_vm_do_failover(void)
     }
     /* Notify COLO incoming thread that failover work is finished */
     qemu_sem_post(&mis->colo_incoming_sem);
+
     /* For Secondary VM, jump to incoming co */
     if (mis->migration_incoming_co) {
         qemu_coroutine_enter(mis->migration_incoming_co);
@@ -262,7 +263,7 @@ COLOStatus *qmp_query_colo_status(Error **errp)
     case FAILOVER_STATUS_NONE:
         s->reason = COLO_EXIT_REASON_NONE;
         break;
-    case FAILOVER_STATUS_REQUIRE:
+    case FAILOVER_STATUS_COMPLETED:
         s->reason = COLO_EXIT_REASON_REQUEST;
         break;
     default:
@@ -582,7 +583,7 @@ out:
         qapi_event_send_colo_exit(COLO_MODE_PRIMARY,
                                   COLO_EXIT_REASON_ERROR);
         break;
-    case FAILOVER_STATUS_REQUIRE:
+    case FAILOVER_STATUS_COMPLETED:
         qapi_event_send_colo_exit(COLO_MODE_PRIMARY,
                                   COLO_EXIT_REASON_REQUEST);
         break;
@@ -854,7 +855,7 @@ out:
         qapi_event_send_colo_exit(COLO_MODE_SECONDARY,
                                   COLO_EXIT_REASON_ERROR);
         break;
-    case FAILOVER_STATUS_REQUIRE:
+    case FAILOVER_STATUS_COMPLETED:
         qapi_event_send_colo_exit(COLO_MODE_SECONDARY,
                                   COLO_EXIT_REASON_REQUEST);
         break;
-- 
2.17.GIT

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

* [Qemu-devel] [PATCH 3/3] Migration/colo.c: Make COLO node running after failover
  2019-02-26  5:34 [Qemu-devel] [PATCH 0/3] Migration/colo.c: Fix upstream bugs when occur failover Zhang Chen
  2019-02-26  5:34 ` [Qemu-devel] [PATCH 1/3] Migration/colo.c: Fix double close bug when occur COLO failover Zhang Chen
  2019-02-26  5:34 ` [Qemu-devel] [PATCH 2/3] Migration/colo.c: Fix COLO failover status error Zhang Chen
@ 2019-02-26  5:34 ` Zhang Chen
  2019-02-26 11:01   ` Dr. David Alan Gilbert
  2 siblings, 1 reply; 10+ messages in thread
From: Zhang Chen @ 2019-02-26  5:34 UTC (permalink / raw)
  To: Li Zhijian, Zhang Chen, Dr. David Alan Gilbert, Juan Quintela,
	zhanghailiang, qemu-dev
  Cc: Zhang Chen

From: Zhang Chen <chen.zhang@intel.com>

Delay to close COLO for auto start VM after failover.

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

diff --git a/migration/colo.c b/migration/colo.c
index a13acac192..89325952c7 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -875,7 +875,6 @@ out:
         qemu_fclose(mis->to_src_file);
         mis->to_src_file = NULL;
     }
-    migration_incoming_disable_colo();
 
     rcu_unregister_thread();
     return NULL;
diff --git a/migration/migration.c b/migration/migration.c
index 37e06b76dc..cec5f529c3 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -383,6 +383,9 @@ static void process_incoming_migration_bh(void *opaque)
         } else {
             runstate_set(RUN_STATE_PAUSED);
         }
+    } else if (migration_incoming_colo_enabled()) {
+        migration_incoming_disable_colo();
+        vm_start();
     } else {
         runstate_set(global_state_get_runstate());
     }
-- 
2.17.GIT

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

* Re: [Qemu-devel] [PATCH 1/3] Migration/colo.c: Fix double close bug when occur COLO failover
  2019-02-26  5:34 ` [Qemu-devel] [PATCH 1/3] Migration/colo.c: Fix double close bug when occur COLO failover Zhang Chen
@ 2019-02-26 10:36   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 10+ messages in thread
From: Dr. David Alan Gilbert @ 2019-02-26 10:36 UTC (permalink / raw)
  To: Zhang Chen; +Cc: Li Zhijian, Zhang Chen, Juan Quintela, zhanghailiang, qemu-dev

* Zhang Chen (chen.zhang@intel.com) wrote:
> From: Zhang Chen <chen.zhang@intel.com>
> 
> In migration_incoming_state_destroy(void) will check the mis->to_src_file
> to double close the mis->to_src_file when occur COLO failover.
> 
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>

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

> ---
>  migration/colo.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/migration/colo.c b/migration/colo.c
> index 398b239d1c..a916dc178c 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -872,6 +872,7 @@ out:
>      /* Must be called after failover BH is completed */
>      if (mis->to_src_file) {
>          qemu_fclose(mis->to_src_file);
> +        mis->to_src_file = NULL;
>      }
>      migration_incoming_disable_colo();
>  
> -- 
> 2.17.GIT
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

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

* Re: [Qemu-devel] [PATCH 2/3] Migration/colo.c: Fix COLO failover status error
  2019-02-26  5:34 ` [Qemu-devel] [PATCH 2/3] Migration/colo.c: Fix COLO failover status error Zhang Chen
@ 2019-02-26 10:55   ` Dr. David Alan Gilbert
  2019-02-26 11:25     ` Zhang, Chen
  0 siblings, 1 reply; 10+ messages in thread
From: Dr. David Alan Gilbert @ 2019-02-26 10:55 UTC (permalink / raw)
  To: Zhang Chen; +Cc: Li Zhijian, Zhang Chen, Juan Quintela, zhanghailiang, qemu-dev

* Zhang Chen (chen.zhang@intel.com) wrote:
> From: Zhang Chen <chen.zhang@intel.com>
> 
> When finished COLO failover, the status is FAILOVER_STATUS_COMPLETED.
> The origin codes misunderstand the FAILOVER_STATUS_REQUIRE.
> 
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>

Why do these 'case's have to only deal with COMPLETED - what stops the
REQUIRE/ACTIVE states appearing when these routines check the status;
even if those states only happen for a short amount of time?

Dave

> ---
>  migration/colo.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/migration/colo.c b/migration/colo.c
> index a916dc178c..a13acac192 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -121,6 +121,7 @@ static void secondary_vm_do_failover(void)
>      }
>      /* Notify COLO incoming thread that failover work is finished */
>      qemu_sem_post(&mis->colo_incoming_sem);
> +
>      /* For Secondary VM, jump to incoming co */
>      if (mis->migration_incoming_co) {
>          qemu_coroutine_enter(mis->migration_incoming_co);
> @@ -262,7 +263,7 @@ COLOStatus *qmp_query_colo_status(Error **errp)
>      case FAILOVER_STATUS_NONE:
>          s->reason = COLO_EXIT_REASON_NONE;
>          break;
> -    case FAILOVER_STATUS_REQUIRE:
> +    case FAILOVER_STATUS_COMPLETED:
>          s->reason = COLO_EXIT_REASON_REQUEST;
>          break;
>      default:
> @@ -582,7 +583,7 @@ out:
>          qapi_event_send_colo_exit(COLO_MODE_PRIMARY,
>                                    COLO_EXIT_REASON_ERROR);
>          break;
> -    case FAILOVER_STATUS_REQUIRE:
> +    case FAILOVER_STATUS_COMPLETED:
>          qapi_event_send_colo_exit(COLO_MODE_PRIMARY,
>                                    COLO_EXIT_REASON_REQUEST);
>          break;
> @@ -854,7 +855,7 @@ out:
>          qapi_event_send_colo_exit(COLO_MODE_SECONDARY,
>                                    COLO_EXIT_REASON_ERROR);
>          break;
> -    case FAILOVER_STATUS_REQUIRE:
> +    case FAILOVER_STATUS_COMPLETED:
>          qapi_event_send_colo_exit(COLO_MODE_SECONDARY,
>                                    COLO_EXIT_REASON_REQUEST);
>          break;
> -- 
> 2.17.GIT
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

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

* Re: [Qemu-devel] [PATCH 3/3] Migration/colo.c: Make COLO node running after failover
  2019-02-26  5:34 ` [Qemu-devel] [PATCH 3/3] Migration/colo.c: Make COLO node running after failover Zhang Chen
@ 2019-02-26 11:01   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 10+ messages in thread
From: Dr. David Alan Gilbert @ 2019-02-26 11:01 UTC (permalink / raw)
  To: Zhang Chen; +Cc: Li Zhijian, Zhang Chen, Juan Quintela, zhanghailiang, qemu-dev

* Zhang Chen (chen.zhang@intel.com) wrote:
> From: Zhang Chen <chen.zhang@intel.com>
> 
> Delay to close COLO for auto start VM after failover.
> 
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>

Yes, I guess the state sent over the global state is probably
RUN_STATE_COLO so it doesn't autostart on new machine types, and this
looks like it would fix it.


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

> ---
>  migration/colo.c      | 1 -
>  migration/migration.c | 3 +++
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/migration/colo.c b/migration/colo.c
> index a13acac192..89325952c7 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -875,7 +875,6 @@ out:
>          qemu_fclose(mis->to_src_file);
>          mis->to_src_file = NULL;
>      }
> -    migration_incoming_disable_colo();
>  
>      rcu_unregister_thread();
>      return NULL;
> diff --git a/migration/migration.c b/migration/migration.c
> index 37e06b76dc..cec5f529c3 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -383,6 +383,9 @@ static void process_incoming_migration_bh(void *opaque)
>          } else {
>              runstate_set(RUN_STATE_PAUSED);
>          }
> +    } else if (migration_incoming_colo_enabled()) {
> +        migration_incoming_disable_colo();
> +        vm_start();
>      } else {
>          runstate_set(global_state_get_runstate());
>      }
> -- 
> 2.17.GIT
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

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

* Re: [Qemu-devel] [PATCH 2/3] Migration/colo.c: Fix COLO failover status error
  2019-02-26 10:55   ` Dr. David Alan Gilbert
@ 2019-02-26 11:25     ` Zhang, Chen
  2019-02-28 13:02       ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 10+ messages in thread
From: Zhang, Chen @ 2019-02-26 11:25 UTC (permalink / raw)
  To: Dr. David Alan Gilbert
  Cc: Li Zhijian, Zhang Chen, Juan Quintela, zhanghailiang, qemu-dev


-----Original Message-----
From: Dr. David Alan Gilbert [mailto:dgilbert@redhat.com] 
Sent: Tuesday, February 26, 2019 6:55 PM
To: Zhang, Chen <chen.zhang@intel.com>
Cc: Li Zhijian <lizhijian@cn.fujitsu.com>; Zhang Chen <zhangckid@gmail.com>; Juan Quintela <quintela@redhat.com>; zhanghailiang <zhang.zhanghailiang@huawei.com>; qemu-dev <qemu-devel@nongnu.org>
Subject: Re: [PATCH 2/3] Migration/colo.c: Fix COLO failover status error

* Zhang Chen (chen.zhang@intel.com) wrote:
> From: Zhang Chen <chen.zhang@intel.com>
> 
> When finished COLO failover, the status is FAILOVER_STATUS_COMPLETED.
> The origin codes misunderstand the FAILOVER_STATUS_REQUIRE.
> 
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>

Why do these 'case's have to only deal with COMPLETED - what stops the REQUIRE/ACTIVE states appearing when these routines check the status; even if those states only happen for a short amount of time?

Yes, other status just marked the failover processing. We can see colo_failover_bh(), the REQUIRE/ACTIVE only exist for a very short time.


Thanks
Zhang Chen

Dave

> ---
>  migration/colo.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/migration/colo.c b/migration/colo.c index 
> a916dc178c..a13acac192 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -121,6 +121,7 @@ static void secondary_vm_do_failover(void)
>      }
>      /* Notify COLO incoming thread that failover work is finished */
>      qemu_sem_post(&mis->colo_incoming_sem);
> +
>      /* For Secondary VM, jump to incoming co */
>      if (mis->migration_incoming_co) {
>          qemu_coroutine_enter(mis->migration_incoming_co);
> @@ -262,7 +263,7 @@ COLOStatus *qmp_query_colo_status(Error **errp)
>      case FAILOVER_STATUS_NONE:
>          s->reason = COLO_EXIT_REASON_NONE;
>          break;
> -    case FAILOVER_STATUS_REQUIRE:
> +    case FAILOVER_STATUS_COMPLETED:
>          s->reason = COLO_EXIT_REASON_REQUEST;
>          break;
>      default:
> @@ -582,7 +583,7 @@ out:
>          qapi_event_send_colo_exit(COLO_MODE_PRIMARY,
>                                    COLO_EXIT_REASON_ERROR);
>          break;
> -    case FAILOVER_STATUS_REQUIRE:
> +    case FAILOVER_STATUS_COMPLETED:
>          qapi_event_send_colo_exit(COLO_MODE_PRIMARY,
>                                    COLO_EXIT_REASON_REQUEST);
>          break;
> @@ -854,7 +855,7 @@ out:
>          qapi_event_send_colo_exit(COLO_MODE_SECONDARY,
>                                    COLO_EXIT_REASON_ERROR);
>          break;
> -    case FAILOVER_STATUS_REQUIRE:
> +    case FAILOVER_STATUS_COMPLETED:
>          qapi_event_send_colo_exit(COLO_MODE_SECONDARY,
>                                    COLO_EXIT_REASON_REQUEST);
>          break;
> --
> 2.17.GIT
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

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

* Re: [Qemu-devel] [PATCH 2/3] Migration/colo.c: Fix COLO failover status error
  2019-02-26 11:25     ` Zhang, Chen
@ 2019-02-28 13:02       ` Dr. David Alan Gilbert
  2019-02-28 13:29         ` Zhang, Chen
  0 siblings, 1 reply; 10+ messages in thread
From: Dr. David Alan Gilbert @ 2019-02-28 13:02 UTC (permalink / raw)
  To: Zhang, Chen
  Cc: Li Zhijian, Zhang Chen, Juan Quintela, zhanghailiang, qemu-dev

* Zhang, Chen (chen.zhang@intel.com) wrote:
> 
> -----Original Message-----
> From: Dr. David Alan Gilbert [mailto:dgilbert@redhat.com] 
> Sent: Tuesday, February 26, 2019 6:55 PM
> To: Zhang, Chen <chen.zhang@intel.com>
> Cc: Li Zhijian <lizhijian@cn.fujitsu.com>; Zhang Chen <zhangckid@gmail.com>; Juan Quintela <quintela@redhat.com>; zhanghailiang <zhang.zhanghailiang@huawei.com>; qemu-dev <qemu-devel@nongnu.org>
> Subject: Re: [PATCH 2/3] Migration/colo.c: Fix COLO failover status error
> 
> * Zhang Chen (chen.zhang@intel.com) wrote:
> > From: Zhang Chen <chen.zhang@intel.com>
> > 
> > When finished COLO failover, the status is FAILOVER_STATUS_COMPLETED.
> > The origin codes misunderstand the FAILOVER_STATUS_REQUIRE.
> > 
> > Signed-off-by: Zhang Chen <chen.zhang@intel.com>
> 
> > Why do these 'case's have to only deal with COMPLETED - what stops the REQUIRE/ACTIVE states appearing when these routines check the status; even if those states only happen for a short amount of time?
> 
> Yes, other status just marked the failover processing. We can see colo_failover_bh(), the REQUIRE/ACTIVE only exist for a very short time.

But those other states do exist - so don't these case statements have to
do something with them?

Dave

> 
> Thanks
> Zhang Chen
> 
> Dave
> 
> > ---
> >  migration/colo.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/migration/colo.c b/migration/colo.c index 
> > a916dc178c..a13acac192 100644
> > --- a/migration/colo.c
> > +++ b/migration/colo.c
> > @@ -121,6 +121,7 @@ static void secondary_vm_do_failover(void)
> >      }
> >      /* Notify COLO incoming thread that failover work is finished */
> >      qemu_sem_post(&mis->colo_incoming_sem);
> > +
> >      /* For Secondary VM, jump to incoming co */
> >      if (mis->migration_incoming_co) {
> >          qemu_coroutine_enter(mis->migration_incoming_co);
> > @@ -262,7 +263,7 @@ COLOStatus *qmp_query_colo_status(Error **errp)
> >      case FAILOVER_STATUS_NONE:
> >          s->reason = COLO_EXIT_REASON_NONE;
> >          break;
> > -    case FAILOVER_STATUS_REQUIRE:
> > +    case FAILOVER_STATUS_COMPLETED:
> >          s->reason = COLO_EXIT_REASON_REQUEST;
> >          break;
> >      default:
> > @@ -582,7 +583,7 @@ out:
> >          qapi_event_send_colo_exit(COLO_MODE_PRIMARY,
> >                                    COLO_EXIT_REASON_ERROR);
> >          break;
> > -    case FAILOVER_STATUS_REQUIRE:
> > +    case FAILOVER_STATUS_COMPLETED:
> >          qapi_event_send_colo_exit(COLO_MODE_PRIMARY,
> >                                    COLO_EXIT_REASON_REQUEST);
> >          break;
> > @@ -854,7 +855,7 @@ out:
> >          qapi_event_send_colo_exit(COLO_MODE_SECONDARY,
> >                                    COLO_EXIT_REASON_ERROR);
> >          break;
> > -    case FAILOVER_STATUS_REQUIRE:
> > +    case FAILOVER_STATUS_COMPLETED:
> >          qapi_event_send_colo_exit(COLO_MODE_SECONDARY,
> >                                    COLO_EXIT_REASON_REQUEST);
> >          break;
> > --
> > 2.17.GIT
> > 
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

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

* Re: [Qemu-devel] [PATCH 2/3] Migration/colo.c: Fix COLO failover status error
  2019-02-28 13:02       ` Dr. David Alan Gilbert
@ 2019-02-28 13:29         ` Zhang, Chen
  0 siblings, 0 replies; 10+ messages in thread
From: Zhang, Chen @ 2019-02-28 13:29 UTC (permalink / raw)
  To: Dr. David Alan Gilbert
  Cc: Li Zhijian, Zhang Chen, Juan Quintela, zhanghailiang, qemu-dev



-----Original Message-----
From: Dr. David Alan Gilbert [mailto:dgilbert@redhat.com] 
Sent: Thursday, February 28, 2019 9:03 PM
To: Zhang, Chen <chen.zhang@intel.com>
Cc: Li Zhijian <lizhijian@cn.fujitsu.com>; Zhang Chen <zhangckid@gmail.com>; Juan Quintela <quintela@redhat.com>; zhanghailiang <zhang.zhanghailiang@huawei.com>; qemu-dev <qemu-devel@nongnu.org>
Subject: Re: [PATCH 2/3] Migration/colo.c: Fix COLO failover status error

* Zhang, Chen (chen.zhang@intel.com) wrote:
> 
> -----Original Message-----
> From: Dr. David Alan Gilbert [mailto:dgilbert@redhat.com]
> Sent: Tuesday, February 26, 2019 6:55 PM
> To: Zhang, Chen <chen.zhang@intel.com>
> Cc: Li Zhijian <lizhijian@cn.fujitsu.com>; Zhang Chen 
> <zhangckid@gmail.com>; Juan Quintela <quintela@redhat.com>; 
> zhanghailiang <zhang.zhanghailiang@huawei.com>; qemu-dev 
> <qemu-devel@nongnu.org>
> Subject: Re: [PATCH 2/3] Migration/colo.c: Fix COLO failover status 
> error
> 
> * Zhang Chen (chen.zhang@intel.com) wrote:
> > From: Zhang Chen <chen.zhang@intel.com>
> > 
> > When finished COLO failover, the status is FAILOVER_STATUS_COMPLETED.
> > The origin codes misunderstand the FAILOVER_STATUS_REQUIRE.
> > 
> > Signed-off-by: Zhang Chen <chen.zhang@intel.com>
> 
> > Why do these 'case's have to only deal with COMPLETED - what stops the REQUIRE/ACTIVE states appearing when these routines check the status; even if those states only happen for a short amount of time?
> 
> Yes, other status just marked the failover processing. We can see colo_failover_bh(), the REQUIRE/ACTIVE only exist for a very short time.

But those other states do exist - so don't these case statements have to do something with them?

Yes, you are right.
I will add another one patch to handle other states in this series next version.

Thanks
Zhang Chen

Dave

> 
> Thanks
> Zhang Chen
> 
> Dave
> 
> > ---
> >  migration/colo.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/migration/colo.c b/migration/colo.c index
> > a916dc178c..a13acac192 100644
> > --- a/migration/colo.c
> > +++ b/migration/colo.c
> > @@ -121,6 +121,7 @@ static void secondary_vm_do_failover(void)
> >      }
> >      /* Notify COLO incoming thread that failover work is finished */
> >      qemu_sem_post(&mis->colo_incoming_sem);
> > +
> >      /* For Secondary VM, jump to incoming co */
> >      if (mis->migration_incoming_co) {
> >          qemu_coroutine_enter(mis->migration_incoming_co);
> > @@ -262,7 +263,7 @@ COLOStatus *qmp_query_colo_status(Error **errp)
> >      case FAILOVER_STATUS_NONE:
> >          s->reason = COLO_EXIT_REASON_NONE;
> >          break;
> > -    case FAILOVER_STATUS_REQUIRE:
> > +    case FAILOVER_STATUS_COMPLETED:
> >          s->reason = COLO_EXIT_REASON_REQUEST;
> >          break;
> >      default:
> > @@ -582,7 +583,7 @@ out:
> >          qapi_event_send_colo_exit(COLO_MODE_PRIMARY,
> >                                    COLO_EXIT_REASON_ERROR);
> >          break;
> > -    case FAILOVER_STATUS_REQUIRE:
> > +    case FAILOVER_STATUS_COMPLETED:
> >          qapi_event_send_colo_exit(COLO_MODE_PRIMARY,
> >                                    COLO_EXIT_REASON_REQUEST);
> >          break;
> > @@ -854,7 +855,7 @@ out:
> >          qapi_event_send_colo_exit(COLO_MODE_SECONDARY,
> >                                    COLO_EXIT_REASON_ERROR);
> >          break;
> > -    case FAILOVER_STATUS_REQUIRE:
> > +    case FAILOVER_STATUS_COMPLETED:
> >          qapi_event_send_colo_exit(COLO_MODE_SECONDARY,
> >                                    COLO_EXIT_REASON_REQUEST);
> >          break;
> > --
> > 2.17.GIT
> > 
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

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

end of thread, other threads:[~2019-02-28 13:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26  5:34 [Qemu-devel] [PATCH 0/3] Migration/colo.c: Fix upstream bugs when occur failover Zhang Chen
2019-02-26  5:34 ` [Qemu-devel] [PATCH 1/3] Migration/colo.c: Fix double close bug when occur COLO failover Zhang Chen
2019-02-26 10:36   ` Dr. David Alan Gilbert
2019-02-26  5:34 ` [Qemu-devel] [PATCH 2/3] Migration/colo.c: Fix COLO failover status error Zhang Chen
2019-02-26 10:55   ` Dr. David Alan Gilbert
2019-02-26 11:25     ` Zhang, Chen
2019-02-28 13:02       ` Dr. David Alan Gilbert
2019-02-28 13:29         ` Zhang, Chen
2019-02-26  5:34 ` [Qemu-devel] [PATCH 3/3] Migration/colo.c: Make COLO node running after failover Zhang Chen
2019-02-26 11:01   ` Dr. David Alan Gilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.