[Kimchi-devel] [PATCH] [Kimchi] Issue #1053: View console, shutdown socket server for VM who's console is not readable instead writeable.
Chandra Shekhar Reddy Potula
chandra at linux.vnet.ibm.com
Thu Oct 13 12:11:25 UTC 2016
Reviewed and Tested-by: Chandra Shekhar Reddy Potula
<chandra at linux.vnet.ibm.com>
On 10/13/16 2:36 PM, archus at linux.vnet.ibm.com wrote:
> From: Archana Singh <archus at linux.vnet.ibm.com>
>
> Socket server gets closed for VM's serial console connection if its not readable instead writeable.
> This is due to fact that _is_vm_listening_serial(...) only call _test_output if its readable
> and not on writeable. Adding libvirt.VIR_STREAM_EVENT_WRITABLE solve the issue.
> Also added libvirt.VIR_STREAM_EVENT_HANGUP event so that in case of hangup also
> console gets connected.
>
> Signed-off-by: Archana Singh <archus at linux.vnet.ibm.com>
> ---
> serialconsole.py | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/serialconsole.py b/serialconsole.py
> index 13ef331..725f55d 100644
> --- a/serialconsole.py
> +++ b/serialconsole.py
> @@ -101,7 +101,9 @@ class SocketServer(Process):
> while not is_listening:
> libvirt.virEventRunDefaultImpl()
>
> - console.eventAddCallback(libvirt.VIR_STREAM_EVENT_READABLE,
> + console.eventAddCallback(libvirt.VIR_STREAM_EVENT_READABLE |
> + libvirt.VIR_STREAM_EVENT_WRITABLE |
> + libvirt.VIR_STREAM_EVENT_HANGUP,
> _test_output,
> None)
> libvirt_loop = threading.Thread(target=_event_loop)
> @@ -111,6 +113,7 @@ class SocketServer(Process):
> libvirt_loop.join(1)
>
> if not libvirt_loop.is_alive():
> + wok_log.error("console libvirt stream is not listening to event")
> console.eventRemoveCallback()
> return True
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20161013/61ecc4bf/attachment.html>
More information about the Kimchi-devel
mailing list