qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Qemu-devel] Socket reconnection.


From: Krumme, Chris
Subject: RE: [Qemu-devel] Socket reconnection.
Date: Wed, 2 Dec 2009 14:35:29 -0800

Hello Ian,

Pasting chunks, then commenting:

+static int qemu_chr_sched_reconnect(TCPCharDriver *s)
+{
+    struct reconnect_list *new = qemu_malloc(sizeof(*new));
+    struct timeval tv;
+
+    if(!new)
+        return 1;


Qemu_malloc will never return 0, so sched function can return void.


+    while (this) {
+        if (this->when <= now) {
+            if(qemu_chr_connect_socket(this->s)) {
+                if(prev)
+                    prev->next = this->next;
+                else
+                    rc_list = NULL;
+                qemu_chr_event(this->s->chr, CHR_EVENT_RECONNECTED);
+                free(this);
+               if(prev)
+                       this = prev;
+               else
+                       this = NULL;
+            }
+            else {
+                this->when += this->s->reconnect * 1000000;
+            }
+        }
+        prev = this;
+       if(this)
+            this = this->next;

This is a mixture of tabs and spaces, for new code pick one.

The if(prev) can just be this = prev;  if prev is NULL you want NULL
anyway.

Thanks

Chris
 

> -----Original Message-----
> From: Ian Molton [mailto:address@hidden 
> Sent: Wednesday, December 02, 2009 4:41 AM
> To: Anthony Liguori
> Cc: Krumme, Chris; address@hidden
> Subject: Re: [Qemu-devel] Socket reconnection.
> 
> Anthony Liguori wrote:
> 
> > sleep() in qemu is very, very wrong.  It will pause the guest's
> > execution and all sorts of badness can ensue.
> 
> Quite...
> 
> > The right thing to do is set a timer and not generate data while
> > disconnected.
> 
> New patch attached, now with less crack...
> 
> >  I still am not confident this is really a great thing to do.
> 
> What other option is there than to drop the ability to feed entropy to
> the guest when the hosts egd link drops?
> 
> btw. Does anyone know how to get t-bird to inline patches?
> 
> -Ian
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]