On 06/11/2013 04:34 PM, Cole Robinson wrote: > On 06/11/2013 03:32 AM, Martin Kletzander wrote: >> When LXC guest was shut down while its console was open, virt-manager >> got stuck in a loop due to the fact that the readable event was not >> properly removed from the callback. Mimicking the behavior from >> libvirt's tolls/console.c file, this patch properly closes the console >> in case stream.recv() returns empty string. >> >> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=968896 >> >> Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx> >> --- >> virtManager/serialcon.py | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/virtManager/serialcon.py b/virtManager/serialcon.py >> index b02a8be..7288a22 100644 >> --- a/virtManager/serialcon.py >> +++ b/virtManager/serialcon.py >> @@ -1,5 +1,5 @@ >> # >> -# Copyright (C) 2006 Red Hat, Inc. >> +# Copyright (C) 2006, 2013 Red Hat, Inc. >> # Copyright (C) 2006 Daniel P. Berrange <berrange@xxxxxxxxxx> >> # >> # This program is free software; you can redistribute it and/or modify >> @@ -158,6 +158,8 @@ class LibvirtConsoleConnection(ConsoleConnection): >> >> if got == -2: >> return >> + if len(got) == 0: >> + self.close() >> >> queued_text = bool(self.streamToTerminal) >> self.streamToTerminal += got >> > > ACK, please push. > > - Cole > Thanks, pushed. Martin _______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list