From nobody Mon Feb 9 23:38:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150029920619981.03131102261602; Mon, 17 Jul 2017 06:46:46 -0700 (PDT) Received: from localhost ([::1]:50537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX6MF-0007EY-QP for importer@patchew.org; Mon, 17 Jul 2017 09:46:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX6IX-0003mU-UR for qemu-devel@nongnu.org; Mon, 17 Jul 2017 09:42:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dX6IU-0005JH-Sn for qemu-devel@nongnu.org; Mon, 17 Jul 2017 09:42:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13525) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dX6IU-0005J4-Jl for qemu-devel@nongnu.org; Mon, 17 Jul 2017 09:42:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 896FE61BAC for ; Mon, 17 Jul 2017 13:42:49 +0000 (UTC) Received: from secure.mitica (ovpn-117-165.ams2.redhat.com [10.36.117.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 344DE5D6A2; Mon, 17 Jul 2017 13:42:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 896FE61BAC Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 896FE61BAC From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 17 Jul 2017 15:42:22 +0200 Message-Id: <20170717134238.1966-2-quintela@redhat.com> In-Reply-To: <20170717134238.1966-1-quintela@redhat.com> References: <20170717134238.1966-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Jul 2017 13:42:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 01/17] migrate: Add gboolean return type to migrate_channel_process_incoming X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela --- 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" =20 -void migration_channel_process_incoming(QIOChannel *ioc) +gboolean migration_channel_process_incoming(QIOChannel *ioc) { MigrationState *s =3D migrate_get_current(); =20 @@ -39,6 +39,7 @@ void migration_channel_process_incoming(QIOChannel *ioc) QEMUFile *f =3D qemu_fopen_channel_input(ioc); migration_fd_process_incoming(f); } + return FALSE; /* unregister */ } =20 =20 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 @@ =20 #include "io/channel.h" =20 -void migration_channel_process_incoming(QIOChannel *ioc); +gboolean migration_channel_process_incoming(QIOChannel *ioc); =20 void migration_channel_connect(MigrationState *s, QIOChannel *ioc, diff --git a/migration/exec.c b/migration/exec.c index 08b599e..2827f15 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -47,9 +47,11 @@ static gboolean exec_accept_incoming_migration(QIOChanne= l *ioc, GIOCondition condition, gpointer opaque) { - migration_channel_process_incoming(ioc); + gboolean result; + + result =3D migration_channel_process_incoming(ioc); object_unref(OBJECT(ioc)); - return FALSE; /* unregister */ + return result; } =20 void exec_start_incoming_migration(const char *command, Error **errp) diff --git a/migration/socket.c b/migration/socket.c index 757d382..6195596 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -136,25 +136,29 @@ static gboolean socket_accept_incoming_migration(QIOC= hannel *ioc, { QIOChannelSocket *sioc; Error *err =3D NULL; + gboolean result; =20 sioc =3D qio_channel_socket_accept(QIO_CHANNEL_SOCKET(ioc), &err); if (!sioc) { error_report("could not accept migration connection (%s)", error_get_pretty(err)); + result =3D FALSE; /* unregister */ goto out; } =20 trace_migration_socket_incoming_accepted(); =20 qio_channel_set_name(QIO_CHANNEL(sioc), "migration-socket-incoming"); - migration_channel_process_incoming(QIO_CHANNEL(sioc)); + result =3D migration_channel_process_incoming(QIO_CHANNEL(sioc)); object_unref(OBJECT(sioc)); =20 out: - /* Close listening socket as its no longer needed */ - qio_channel_close(ioc, NULL); - return FALSE; /* unregister */ + if (result =3D=3D FALSE) { + /* Close listening socket as its no longer needed */ + qio_channel_close(ioc, NULL); + } + return result; } =20 =20 --=20 2.9.4