qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qemu-char: Fix missed data on unix socket


From: Nils Carlson
Subject: Re: [Qemu-devel] [PATCH] qemu-char: Fix missed data on unix socket
Date: Mon, 13 Jul 2015 15:15:55 +0200 (CEST)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)

On Mon, 13 Jul 2015, Amit Shah wrote:

On (Mon) 13 Jul 2015 [12:15:22], Paolo Bonzini wrote:


On 13/07/2015 10:13, address@hidden wrote:
Commit 812c1057 introduced HUP detection on unix and tcp sockets prior
to a read in tcp_chr_read. This unfortunately broke CloudStack 4.2
which relied on the old behaviour where data on a socket was readable
even if a HUP was present.

On Linux a working solution seems to be to simply check the HUP after
reading available data, while keeping the original behaviour for windows.

There is then a divergence in behaviour for the two platforms, but this
seems better than breaking a whole software stack.

There is no need to do something special on Windows, I think.  You can
unconditionally check G_IO_HUP after reading.  One nit:

-    if (size == 0) {
+    if (size == 0 || (size < 0 && cond & G_IO_HUP)) {

Please put (cond & G_IO_HUP) within parentheses.

Also, returning TRUE there isn't right - if the connection ends, we
should return FALSE.

I agree that this seems reasonable. I will change it and re-test.



                Amit





reply via email to

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