[libvirt] [PATCH] Fix busy wait loop in LXC container I/O handling

Eric Blake eblake at redhat.com
Mon Nov 11 15:08:40 UTC 2013


On 11/11/2013 06:55 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> If the host side of an LXC container console disconnected
> and the guest side continued to write data, until the PTY
> buffer filled up, the LXC controller would busy wait. It
> would repeatedly see POLLHUP from poll() and not disable
> the watch.
> 
> This was due to some bogus logic detecting blocking
> conditions. Upon seeing a POLLHUP we must disable all
> reading & writing from the PTY, and setup the epoll to
> wake us up again when the connection comes back.
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/lxc/lxc_controller.c | 32 +++++++++++++++++---------------
>  1 file changed, 17 insertions(+), 15 deletions(-)
> 

>  
> -    VIR_DEBUG("Container watch %d=%d host watch %d=%d",
> -              console->contWatch, contEvents,
> -              console->hostWatch, hostEvents);
> +    VIR_DEBUG("Container watch=%d, events=%d closed=%d;  host watch=%d events=%d closed=%d",

Are the two spaces intentional?

Otherwise, the patch looks okay.

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131111/465e2443/attachment-0001.sig>


More information about the libvir-list mailing list