From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZR47-0008FS-8n for qemu-devel@nongnu.org; Wed, 01 Oct 2014 17:04:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZR41-0007kG-GI for qemu-devel@nongnu.org; Wed, 01 Oct 2014 17:04:03 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:38011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZR41-0007kB-Aj for qemu-devel@nongnu.org; Wed, 01 Oct 2014 17:03:57 -0400 Received: by mail-oi0-f43.google.com with SMTP id u20so924908oif.2 for ; Wed, 01 Oct 2014 14:03:56 -0700 (PDT) Message-ID: <542C6C39.6040209@mvista.com> Date: Wed, 01 Oct 2014 16:03:53 -0500 From: Corey Minyard MIME-Version: 1.0 References: <1411675641-16189-1-git-send-email-minyard@acm.org> <1411675641-16189-6-git-send-email-minyard@acm.org> <542C5197.30506@redhat.com> In-Reply-To: <542C5197.30506@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/6] qemu-char: Add reconnecting to client sockets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , minyard@acm.org, qemu-devel@nongnu.org Cc: bcketchum@gmail.com, mjg59@srcf.ucam.org, hwd@huawei.com, afaerber@suse.de, mst@redhat.com On 10/01/2014 02:10 PM, Eric Blake wrote: > On 09/25/2014 02:07 PM, minyard@acm.org wrote: >> From: Corey Minyard >> >> Adds a "reconnect" option to socket backends that gives a reconnect >> timeout. This only applies to client sockets. If the other end >> of a socket closes the connection, qemu will attempt to reconnect >> after the given number of seconds. >> >> Signed-off-by: Corey Minyard >> --- >> qapi-schema.json | 15 ++++++---- >> qemu-char.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- >> qemu-options.hx | 20 ++++++++----- >> 3 files changed, 105 insertions(+), 18 deletions(-) >> >> >> +static gboolean socket_reconnect_timeout(gpointer opaque); >> + > Do you really need a forward declaration of this static function, or can > you just stick the body of the function here? It's a circular reference. The timeout calls the function to restart the timer, which then references the timeout. > >> @@ -2964,6 +2979,10 @@ static void tcp_chr_close(CharDriverState *chr) >> TCPCharDriver *s = chr->opaque; >> int i; >> >> + if (s->reconnect_timer) { >> + g_source_remove(s->reconnect_timer); >> + s->reconnect_timer = 0; > TAB damage. Dang, I thought I had fixed all those. I'll do another round of patches with that and the unnecessary () removed. -corey