[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/6] qemu-char: Add reconnecting to client socke
From: |
Corey Minyard |
Subject: |
Re: [Qemu-devel] [PATCH 5/6] qemu-char: Add reconnecting to client sockets |
Date: |
Wed, 01 Oct 2014 16:03:53 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 |
On 10/01/2014 02:10 PM, Eric Blake wrote:
> On 09/25/2014 02:07 PM, address@hidden wrote:
>> From: Corey Minyard <address@hidden>
>>
>> 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 <address@hidden>
>> ---
>> 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