From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgwz6-000277-QP for qemu-devel@nongnu.org; Thu, 14 Nov 2013 08:29:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vgwyw-0006Uk-W4 for qemu-devel@nongnu.org; Thu, 14 Nov 2013 08:29:24 -0500 Received: from mail-oa0-x233.google.com ([2607:f8b0:4003:c02::233]:38544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgwyw-0006Tk-R9 for qemu-devel@nongnu.org; Thu, 14 Nov 2013 08:29:14 -0500 Received: by mail-oa0-f51.google.com with SMTP id i4so2207543oah.10 for ; Thu, 14 Nov 2013 05:29:14 -0800 (PST) Sender: Corey Minyard Message-ID: <5284D028.5050505@acm.org> Date: Thu, 14 Nov 2013 07:29:12 -0600 From: Corey Minyard MIME-Version: 1.0 References: <1384273995-16486-1-git-send-email-cminyard@mvista.com> <1384273995-16486-3-git-send-email-cminyard@mvista.com> <52825AAC.9030500@redhat.com> <52826077.3090103@mvista.com> <20131114073236.GC12673@redhat.com> In-Reply-To: <20131114073236.GC12673@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 02/16] qemu-char: Allow a chardev to reconnect if disconnected Reply-To: minyard@acm.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , Corey Minyard Cc: Bret Ketchum , qemu-devel@nongnu.org, =?ISO-8859-1?Q?Andreas_F=E4rber?= On 11/14/2013 01:32 AM, Michael S. Tsirkin wrote: > On Tue, Nov 12, 2013 at 11:08:07AM -0600, Corey Minyard wrote: >> On 11/12/2013 10:43 AM, Eric Blake wrote: >>> On 11/12/2013 09:33 AM, Corey Minyard wrote: >>>> Allow a socket that connects to reconnect on a periodic basis if it >>>> fails to connect at startup or if the connection drops while in use. >>>> >>>> Signed-off-by: Corey Minyard >>>> --- >>>> include/sysemu/char.h | 3 ++ >>>> qemu-char.c | 88 ++++++++++++++++++++++++++++++++++++++++++++------- >>>> qemu-options.hx | 11 +++++-- >>>> 3 files changed, 87 insertions(+), 15 deletions(-) >>>> >>>> +++ b/qemu-options.hx >>>> @@ -1780,8 +1780,9 @@ ETEXI >>>> DEF("chardev", HAS_ARG, QEMU_OPTION_chardev, >>>> "-chardev null,id=id[,mux=on|off]\n" >>>> "-chardev socket,id=id[,host=host],port=host[,to=to][,ipv4][,ipv6][,nodelay]\n" >>>> - " [,server][,nowait][,telnet][,mux=on|off] (tcp)\n" >>>> - "-chardev socket,id=id,path=path[,server][,nowait][,telnet],[mux=on|off] (unix)\n" >>>> + " [,server][,nowait][,telnet][,mux=on|off][,reconnect=seconds] (tcp)\n" >>>> + "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,mux=on|off]\n" >>>> + " [,reconnect=seconds] (unix)\n" >>>> +@option{reconnect} specifies that if the socket does not come up at startup, >>>> +or if the socket is closed for some reason (like the other end exited), >>>> +wait the given number of seconds and attempt to reconnect. >>> Sounds cool. Are you planning on also adding the QMP counterpart for >>> specifying this option when doing hotplugs of a chardev? >> Yes, I need to add that. >> >>> Does reconnect >>> make any sense when not using server mode? >>> >> Actually, it only really makes sense when in client mode. The option >> currently won't do anything in server mode. I can't see a use for it in >> server mode, it doesn't know where to connect. >> >> -corey > I guess it could mean "allow reconnect from a client"? > Yes, rephrasing that is definitely in order. -corey