[spice-gtk,v1,1/3] main: return void on migrate_channel_connect()

Submitted by Victor Toso on Sept. 4, 2019, 12:20 p.m.

Details

Message ID 20190904122041.23408-1-victortoso@redhat.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Victor Toso Sept. 4, 2019, 12:20 p.m.
From: Victor Toso <me@victortoso.com>

The migration process would happen in idle, so the process only fails
at a later time. No call to migrate_channel_connect() is actually
checking the return value.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 src/channel-main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/channel-main.c b/src/channel-main.c
index afdc1ce..a1e5498 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -2168,15 +2168,14 @@  static void migrate_channel_new_cb(SpiceSession *s, SpiceChannel *channel, gpoin
                      G_CALLBACK(migrate_channel_event_cb), data);
 }
 
-static SpiceChannel* migrate_channel_connect(spice_migrate *mig, int type, int id)
+static void
+migrate_channel_connect(spice_migrate *mig, int type, int id)
 {
     SPICE_DEBUG("migrate_channel_connect %d:%d", type, id);
 
     SpiceChannel *newc = spice_channel_new(mig->session, type, id);
     spice_channel_connect(newc);
     mig->nchannels++;
-
-    return newc;
 }
 
 /* coroutine context */

Comments

> 
> From: Victor Toso <me@victortoso.com>
> 
> The migration process would happen in idle, so the process only fails
> at a later time. No call to migrate_channel_connect() is actually
> checking the return value.
> 
> Signed-off-by: Victor Toso <victortoso@redhat.com>

Sure,
Acked-by: Frediano Ziglio <fziglio@redhat.com>

The question however is who is owning the pointer?
Why was returned without ownership?

> ---
>  src/channel-main.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/channel-main.c b/src/channel-main.c
> index afdc1ce..a1e5498 100644
> --- a/src/channel-main.c
> +++ b/src/channel-main.c
> @@ -2168,15 +2168,14 @@ static void migrate_channel_new_cb(SpiceSession *s,
> SpiceChannel *channel, gpoin
>                       G_CALLBACK(migrate_channel_event_cb), data);
>  }
>  
> -static SpiceChannel* migrate_channel_connect(spice_migrate *mig, int type,
> int id)
> +static void
> +migrate_channel_connect(spice_migrate *mig, int type, int id)
>  {
>      SPICE_DEBUG("migrate_channel_connect %d:%d", type, id);
>  
>      SpiceChannel *newc = spice_channel_new(mig->session, type, id);
>      spice_channel_connect(newc);
>      mig->nchannels++;
> -
> -    return newc;
>  }
>  
>  /* coroutine context */

Frediano