[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 01/17] migrate: Add gboolean return type to m
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH v5 01/17] migrate: Add gboolean return type to migrate_channel_process_incoming |
Date: |
Thu, 20 Jul 2017 15:00:23 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Wed, Jul 19, 2017 at 04:01:10PM +0100, Dr. David Alan Gilbert wrote:
> * Juan Quintela (address@hidden) wrote:
> > Signed-off-by: Juan Quintela <address@hidden>
> > ---
> > migration/channel.c | 3 ++-
> > migration/channel.h | 2 +-
> > migration/exec.c | 6 ++++--
> > migration/socket.c | 12 ++++++++----
> > 4 files changed, 15 insertions(+), 8 deletions(-)
> >
> > diff --git a/migration/channel.c b/migration/channel.c
> > index 3b7252f..719055d 100644
> > --- a/migration/channel.c
> > +++ b/migration/channel.c
> > @@ -19,7 +19,7 @@
> > #include "qapi/error.h"
> > #include "io/channel-tls.h"
> >
> > -void migration_channel_process_incoming(QIOChannel *ioc)
> > +gboolean migration_channel_process_incoming(QIOChannel *ioc)
> > {
> > MigrationState *s = migrate_get_current();
> >
> > @@ -39,6 +39,7 @@ void migration_channel_process_incoming(QIOChannel *ioc)
> > QEMUFile *f = qemu_fopen_channel_input(ioc);
> > migration_fd_process_incoming(f);
> > }
> > + return FALSE; /* unregister */
> > }
> >
> >
> > diff --git a/migration/channel.h b/migration/channel.h
> > index e4b4057..72cbc9f 100644
> > --- a/migration/channel.h
> > +++ b/migration/channel.h
> > @@ -18,7 +18,7 @@
> >
> > #include "io/channel.h"
> >
> > -void migration_channel_process_incoming(QIOChannel *ioc);
> > +gboolean migration_channel_process_incoming(QIOChannel *ioc);
>
> Can you add a comment here that says what the return value means.
And, looks like we have G_SOURCE_CONTINUE and G_SOURCE_REMOVE:
https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#G-SOURCE-CONTINUE:CAPS
Maybe we can use them as well?
I think the problem is that GSourceFunc's return code (which is a
gboolean) is not clear enough.
--
Peter Xu
[Qemu-devel] [PATCH v5 03/17] qio: Create new qio_channel_{readv, writev}_all, Juan Quintela, 2017/07/17
[Qemu-devel] [PATCH v5 04/17] migration: Add multifd capability, Juan Quintela, 2017/07/17