[Spice-devel,spice-server,08/22] reds: use bool for RedsState::src_do_seamless_migrate

Submitted by Frediano Ziglio on June 16, 2017, 9:13 a.m.

Details

Message ID 20170616091334.31475-9-fziglio@redhat.com
State New
Headers show
Series "reds: Use bool for boolean types" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio June 16, 2017, 9:13 a.m.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/reds-private.h | 4 ++--
 server/reds.c         | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/reds-private.h b/server/reds-private.h
index 37af888..68c3c45 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -94,8 +94,8 @@  struct RedsState {
 
     int mig_inprogress;
     int expect_migrate;
-    int src_do_seamless_migrate; /* per migration. Updated after the migration handshake
-                                    between the 2 servers */
+    bool src_do_seamless_migrate; /* per migration. Updated after the migration handshake
+                                     between the 2 servers */
     bool dst_do_seamless_migrate; /* per migration. Updated after the migration handshake
                                      between the 2 servers */
     GList *mig_target_clients;
diff --git a/server/reds.c b/server/reds.c
index 168b3d8..b0478f2 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1158,7 +1158,7 @@  void reds_on_main_agent_data(RedsState *reds, MainChannelClient *mcc, const void
 
 void reds_on_main_migrate_connected(RedsState *reds, int seamless)
 {
-    reds->src_do_seamless_migrate = seamless;
+    reds->src_do_seamless_migrate = !!seamless;
     if (reds->mig_wait_connect) {
         reds_mig_cleanup(reds);
     }

Comments

On Fri, Jun 16, 2017 at 10:13:20AM +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> ---
>  server/reds-private.h | 4 ++--
>  server/reds.c         | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/server/reds-private.h b/server/reds-private.h
> index 37af888..68c3c45 100644
> --- a/server/reds-private.h
> +++ b/server/reds-private.h
> @@ -94,8 +94,8 @@ struct RedsState {
>  
>      int mig_inprogress;
>      int expect_migrate;
> -    int src_do_seamless_migrate; /* per migration. Updated after the migration handshake
> -                                    between the 2 servers */
> +    bool src_do_seamless_migrate; /* per migration. Updated after the migration handshake
> +                                     between the 2 servers */
>      bool dst_do_seamless_migrate; /* per migration. Updated after the migration handshake
>                                       between the 2 servers */
>      GList *mig_target_clients;
> diff --git a/server/reds.c b/server/reds.c
> index 168b3d8..b0478f2 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -1158,7 +1158,7 @@ void reds_on_main_agent_data(RedsState *reds, MainChannelClient *mcc, const void
>  
>  void reds_on_main_migrate_connected(RedsState *reds, int seamless)
>  {
> -    reds->src_do_seamless_migrate = seamless;
> +    reds->src_do_seamless_migrate = !!seamless;

The only caller passes a bool, dunno if you change 'int seamless' to
bool later? What was your criterion for what to change/not to change?

Christophe

>      if (reds->mig_wait_connect) {
>          reds_mig_cleanup(reds);
>      }
> -- 
> 2.9.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel