mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
serialcon: Fix tracebacks when we get EOF on stream
This commit is contained in:
parent
4201ef9e68
commit
436a5bfc8b
@ -147,6 +147,7 @@ class LibvirtConsoleConnection(ConsoleConnection):
|
||||
events & libvirt.VIR_EVENT_HANDLE_HANGUP):
|
||||
logging.debug("Received stream ERROR/HANGUP, closing console")
|
||||
self.close()
|
||||
return
|
||||
|
||||
if events & libvirt.VIR_EVENT_HANDLE_READABLE:
|
||||
try:
|
||||
@ -157,9 +158,12 @@ class LibvirtConsoleConnection(ConsoleConnection):
|
||||
return
|
||||
|
||||
if got == -2:
|
||||
# This is basically EAGAIN
|
||||
return
|
||||
if len(got) == 0:
|
||||
logging.debug("Received EOF from stream, closing")
|
||||
self.close()
|
||||
return
|
||||
|
||||
queued_text = bool(self.streamToTerminal)
|
||||
self.streamToTerminal += got
|
||||
@ -177,6 +181,7 @@ class LibvirtConsoleConnection(ConsoleConnection):
|
||||
return
|
||||
|
||||
if done == -2:
|
||||
# This is basically EAGAIN
|
||||
return
|
||||
|
||||
self.terminalToStream = self.terminalToStream[done:]
|
||||
|
Loading…
Reference in New Issue
Block a user