diff mbox

[V9,11/20] qapi/migration.json: Rename COLO unknown mode to none mode.

Message ID 20180627204136.4177-12-zhangckid@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhang Chen June 27, 2018, 8:41 p.m. UTC
From: Zhang Chen <chen.zhang@intel.com>

Suggested by Markus Armbruster rename COLO unknown mode to none mode.

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
---
 migration/colo-failover.c |  2 +-
 migration/colo.c          |  2 +-
 qapi/migration.json       | 10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

Comments

Eric Blake June 28, 2018, 9:19 p.m. UTC | #1
On 06/27/2018 03:41 PM, Zhang Chen wrote:
> From: Zhang Chen <chen.zhang@intel.com>
> 
> Suggested by Markus Armbruster rename COLO unknown mode to none mode.
> 
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>
> ---
>   migration/colo-failover.c |  2 +-
>   migration/colo.c          |  2 +-
>   qapi/migration.json       | 10 +++++-----
>   3 files changed, 7 insertions(+), 7 deletions(-)

>   # Since: 2.8
>   ##
>   { 'enum': 'COLOMode',
> -  'data': [ 'unknown', 'primary', 'secondary'] }
> +  'data': [ 'none', 'primary', 'secondary'] }

The deletion of 'unknown' could potentially be a user-visible regression 
visible if COLOMode were in a QMP command; but thankfully the generated 
qapi/qapi-introspect.c does not seem to cover this enum, so it just 
affects internal code for now.

Reviewed-by: Eric Blake <eblake@redhat.com>
Dr. David Alan Gilbert June 29, 2018, 9:14 a.m. UTC | #2
* Eric Blake (eblake@redhat.com) wrote:
> On 06/27/2018 03:41 PM, Zhang Chen wrote:
> > From: Zhang Chen <chen.zhang@intel.com>
> > 
> > Suggested by Markus Armbruster rename COLO unknown mode to none mode.
> > 
> > Signed-off-by: Zhang Chen <chen.zhang@intel.com>
> > ---
> >   migration/colo-failover.c |  2 +-
> >   migration/colo.c          |  2 +-
> >   qapi/migration.json       | 10 +++++-----
> >   3 files changed, 7 insertions(+), 7 deletions(-)
> 
> >   # Since: 2.8
> >   ##
> >   { 'enum': 'COLOMode',
> > -  'data': [ 'unknown', 'primary', 'secondary'] }
> > +  'data': [ 'none', 'primary', 'secondary'] }
> 
> The deletion of 'unknown' could potentially be a user-visible regression
> visible if COLOMode were in a QMP command; but thankfully the generated
> qapi/qapi-introspect.c does not seem to cover this enum, so it just affects
> internal code for now.

Note that the migration capability to enable colo is still x-colo;
so I take that to mean we've still got a free hand to change any part of
the COLO interface until we're happy it's right.

Dave

> Reviewed-by: Eric Blake <eblake@redhat.com>
> 
> -- 
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Zhang Chen June 30, 2018, 2 a.m. UTC | #3
On Fri, Jun 29, 2018 at 5:14 PM, Dr. David Alan Gilbert <dgilbert@redhat.com
> wrote:

> * Eric Blake (eblake@redhat.com) wrote:
> > On 06/27/2018 03:41 PM, Zhang Chen wrote:
> > > From: Zhang Chen <chen.zhang@intel.com>
> > >
> > > Suggested by Markus Armbruster rename COLO unknown mode to none mode.
> > >
> > > Signed-off-by: Zhang Chen <chen.zhang@intel.com>
> > > ---
> > >   migration/colo-failover.c |  2 +-
> > >   migration/colo.c          |  2 +-
> > >   qapi/migration.json       | 10 +++++-----
> > >   3 files changed, 7 insertions(+), 7 deletions(-)
> >
> > >   # Since: 2.8
> > >   ##
> > >   { 'enum': 'COLOMode',
> > > -  'data': [ 'unknown', 'primary', 'secondary'] }
> > > +  'data': [ 'none', 'primary', 'secondary'] }
> >
> > The deletion of 'unknown' could potentially be a user-visible regression
> > visible if COLOMode were in a QMP command; but thankfully the generated
> > qapi/qapi-introspect.c does not seem to cover this enum, so it just
> affects
> > internal code for now.
>
> Note that the migration capability to enable colo is still x-colo;
> so I take that to mean we've still got a free hand to change any part of
> the COLO interface until we're happy it's right.
>
> Dave
>
>
Thanks Eric and Dave.

Zhang Chen



> > Reviewed-by: Eric Blake <eblake@redhat.com>
> >
> > --
> > Eric Blake, Principal Software Engineer
> > Red Hat, Inc.           +1-919-301-3266
> > Virtualization:  qemu.org | libvirt.org
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
>
Markus Armbruster July 3, 2018, 10:57 a.m. UTC | #4
Zhang Chen <zhangckid@gmail.com> writes:

> From: Zhang Chen <chen.zhang@intel.com>
>
> Suggested by Markus Armbruster rename COLO unknown mode to none mode.
>
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>
> ---
>  migration/colo-failover.c |  2 +-
>  migration/colo.c          |  2 +-
>  qapi/migration.json       | 10 +++++-----
>  3 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/migration/colo-failover.c b/migration/colo-failover.c
> index 0ae0c41221..4854a96c92 100644
> --- a/migration/colo-failover.c
> +++ b/migration/colo-failover.c
> @@ -77,7 +77,7 @@ FailoverStatus failover_get_state(void)
>  
>  void qmp_x_colo_lost_heartbeat(Error **errp)
>  {
> -    if (get_colo_mode() == COLO_MODE_UNKNOWN) {
> +    if (get_colo_mode() == COLO_MODE_NONE) {
>          error_setg(errp, QERR_FEATURE_DISABLED, "colo");
>          return;
>      }
> diff --git a/migration/colo.c b/migration/colo.c
> index ab484ad754..8fdb79ac73 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -160,7 +160,7 @@ COLOMode get_colo_mode(void)
>      } else if (migration_incoming_in_colo_state()) {
>          return COLO_MODE_SECONDARY;
>      } else {
> -        return COLO_MODE_UNKNOWN;
> +        return COLO_MODE_NONE;
>      }
>  }
>  
> diff --git a/qapi/migration.json b/qapi/migration.json
> index d8c3b2e443..c24f114104 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -864,18 +864,18 @@
>  ##
>  # @COLOMode:
>  #
> -# The colo mode
> +# The COLO current mode.
>  #
> -# @unknown: unknown mode
> +# @none: None mode.

This could use a bit of polish.  Perhaps:

   # @none: COLO is disabled.

>  #
> -# @primary: master side
> +# @primary: COLO node in primary side.
>  #
> -# @secondary: slave side
> +# @secondary: COLO node in slave side.
>  #
>  # Since: 2.8
>  ##
>  { 'enum': 'COLOMode',
> -  'data': [ 'unknown', 'primary', 'secondary'] }
> +  'data': [ 'none', 'primary', 'secondary'] }
>  
>  ##
>  # @FailoverStatus:

Preferably with the comment improved:
Reviewed-by: Markus Armbruster <armbru@redhat.com>
diff mbox

Patch

diff --git a/migration/colo-failover.c b/migration/colo-failover.c
index 0ae0c41221..4854a96c92 100644
--- a/migration/colo-failover.c
+++ b/migration/colo-failover.c
@@ -77,7 +77,7 @@  FailoverStatus failover_get_state(void)
 
 void qmp_x_colo_lost_heartbeat(Error **errp)
 {
-    if (get_colo_mode() == COLO_MODE_UNKNOWN) {
+    if (get_colo_mode() == COLO_MODE_NONE) {
         error_setg(errp, QERR_FEATURE_DISABLED, "colo");
         return;
     }
diff --git a/migration/colo.c b/migration/colo.c
index ab484ad754..8fdb79ac73 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -160,7 +160,7 @@  COLOMode get_colo_mode(void)
     } else if (migration_incoming_in_colo_state()) {
         return COLO_MODE_SECONDARY;
     } else {
-        return COLO_MODE_UNKNOWN;
+        return COLO_MODE_NONE;
     }
 }
 
diff --git a/qapi/migration.json b/qapi/migration.json
index d8c3b2e443..c24f114104 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -864,18 +864,18 @@ 
 ##
 # @COLOMode:
 #
-# The colo mode
+# The COLO current mode.
 #
-# @unknown: unknown mode
+# @none: None mode.
 #
-# @primary: master side
+# @primary: COLO node in primary side.
 #
-# @secondary: slave side
+# @secondary: COLO node in slave side.
 #
 # Since: 2.8
 ##
 { 'enum': 'COLOMode',
-  'data': [ 'unknown', 'primary', 'secondary'] }
+  'data': [ 'none', 'primary', 'secondary'] }
 
 ##
 # @FailoverStatus: