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? > @@ -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. > @@ -3023,7 +3063,10 @@ static bool qemu_chr_open_socket_fd(CharDriverState *chr, Error **errp) > > if (s->is_listen) { > fd = socket_listen(s->addr, errp); > - } else { > + } else if (s->reconnect_time) { > + fd = socket_connect(s->addr, errp, qemu_chr_socket_connected, chr); > + return (fd >= 0); More TAB damage. Also, the () in the return are not necessary. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org