[{"id":1765532,"web_url":"http://patchwork.ozlabs.org/comment/1765532/","msgid":"<20170908171839.GD2836@work-vm>","list_archive_url":null,"date":"2017-09-08T17:18:40","subject":"Re: [Qemu-devel] [PATCH v7 03/22] migration: Teach it about\n\tG_SOURCE_REMOVE","submitter":{"id":48102,"url":"http://patchwork.ozlabs.org/api/people/48102/","name":"Dr. David Alan Gilbert","email":"dgilbert@redhat.com"},"content":"* Juan Quintela (quintela@redhat.com) wrote:\n> As this is defined on glib 2.32, add compatibility macros for older glibs.\n> \n> Signed-off-by: Juan Quintela <quintela@redhat.com>\n> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>\n> Reviewed-by: Peter Xu <peterx@redhat.com>\n\nI think 03 and 04 could both be merged to current qemu?\n\nI think you could remove the G_SOURCE_CONTINUE/REMOVE defines in\ncontrib/vhost-user-scsi/vhost-user-scsi.c as well.\n\nDave\n\n> ---\n>  include/glib-compat.h | 2 ++\n>  migration/exec.c      | 2 +-\n>  migration/fd.c        | 2 +-\n>  migration/socket.c    | 2 +-\n>  4 files changed, 5 insertions(+), 3 deletions(-)\n> \n> diff --git a/include/glib-compat.h b/include/glib-compat.h\n> index fcffcd3f07..e15aca2d40 100644\n> --- a/include/glib-compat.h\n> +++ b/include/glib-compat.h\n> @@ -223,6 +223,8 @@ static inline gboolean g_hash_table_contains(GHashTable *hash_table,\n>  {\n>      return g_hash_table_lookup_extended(hash_table, key, NULL, NULL);\n>  }\n> +#define G_SOURCE_CONTINUE TRUE\n> +#define G_SOURCE_REMOVE FALSE\n>  #endif\n>  \n>  #ifndef g_assert_true\n> diff --git a/migration/exec.c b/migration/exec.c\n> index 08b599e0e2..f3be1baf2e 100644\n> --- a/migration/exec.c\n> +++ b/migration/exec.c\n> @@ -49,7 +49,7 @@ static gboolean exec_accept_incoming_migration(QIOChannel *ioc,\n>  {\n>      migration_channel_process_incoming(ioc);\n>      object_unref(OBJECT(ioc));\n> -    return FALSE; /* unregister */\n> +    return G_SOURCE_REMOVE;\n>  }\n>  \n>  void exec_start_incoming_migration(const char *command, Error **errp)\n> diff --git a/migration/fd.c b/migration/fd.c\n> index 30f5258a6a..30de4b9847 100644\n> --- a/migration/fd.c\n> +++ b/migration/fd.c\n> @@ -49,7 +49,7 @@ static gboolean fd_accept_incoming_migration(QIOChannel *ioc,\n>  {\n>      migration_channel_process_incoming(ioc);\n>      object_unref(OBJECT(ioc));\n> -    return FALSE; /* unregister */\n> +    return G_SOURCE_REMOVE;\n>  }\n>  \n>  void fd_start_incoming_migration(const char *infd, Error **errp)\n> diff --git a/migration/socket.c b/migration/socket.c\n> index 757d3821a1..b02d37d7a3 100644\n> --- a/migration/socket.c\n> +++ b/migration/socket.c\n> @@ -154,7 +154,7 @@ static gboolean socket_accept_incoming_migration(QIOChannel *ioc,\n>  out:\n>      /* Close listening socket as its no longer needed */\n>      qio_channel_close(ioc, NULL);\n> -    return FALSE; /* unregister */\n> +    return G_SOURCE_REMOVE;\n>  }\n>  \n>  \n> -- \n> 2.13.5\n> \n--\nDr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dgilbert@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xpkZx6y2cz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  9 Sep 2017 03:19:36 +1000 (AEST)","from localhost ([::1]:46577 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dqMwH-0004vM-Q0\n\tfor incoming@patchwork.ozlabs.org; Fri, 08 Sep 2017 13:19:33 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60179)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dqMvc-0004tt-Pr\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 13:18:53 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dqMvW-0004vS-Tc\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 13:18:51 -0400","from mx1.redhat.com ([209.132.183.28]:35102)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgilbert@redhat.com>) id 1dqMvW-0004uQ-Ld\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 13:18:46 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id A0F354E909\n\tfor <qemu-devel@nongnu.org>; Fri,  8 Sep 2017 17:18:45 +0000 (UTC)","from work-vm (ovpn-116-125.ams2.redhat.com [10.36.116.125])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id C24D05D974;\n\tFri,  8 Sep 2017 17:18:42 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com A0F354E909","Date":"Fri, 8 Sep 2017 18:18:40 +0100","From":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>","To":"Juan Quintela <quintela@redhat.com>","Message-ID":"<20170908171839.GD2836@work-vm>","References":"<20170906115143.27451-1-quintela@redhat.com>\n\t<20170906115143.27451-4-quintela@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170906115143.27451-4-quintela@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tFri, 08 Sep 2017 17:18:45 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 03/22] migration: Teach it about\n\tG_SOURCE_REMOVE","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"lvivier@redhat.com, qemu-devel@nongnu.org, peterx@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]