mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
serialcon: Some fixes for fast data transfer
Our glib integration had a defect that could cause stalls when streaming a lot of data (like doing a cat /var/log/messages) Also, add some tweaks to make the previously stated situation perform better anyways.
This commit is contained in:
parent
a5cb785c62
commit
e830f91d27
@ -179,6 +179,8 @@ def glib_event_timeout_dispatch(opaque):
|
|||||||
data = opaque
|
data = opaque
|
||||||
data.cb(data.timer, data.opaque)
|
data.cb(data.timer, data.opaque)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def glib_event_timeout_add(interval, cb, opaque):
|
def glib_event_timeout_add(interval, cb, opaque):
|
||||||
data = EventTimer()
|
data = EventTimer()
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ class LibvirtConsoleConnection(ConsoleConnection):
|
|||||||
|
|
||||||
if events & libvirt.VIR_EVENT_HANDLE_READABLE:
|
if events & libvirt.VIR_EVENT_HANDLE_READABLE:
|
||||||
try:
|
try:
|
||||||
got = self.stream.recv(1024)
|
got = self.stream.recv(1024 * 100)
|
||||||
except:
|
except:
|
||||||
logging.exception("Error receiving stream data")
|
logging.exception("Error receiving stream data")
|
||||||
self.close()
|
self.close()
|
||||||
@ -154,8 +154,9 @@ class LibvirtConsoleConnection(ConsoleConnection):
|
|||||||
if got == -2:
|
if got == -2:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
queued_text = bool(self.streamToTerminal)
|
||||||
self.streamToTerminal += got
|
self.streamToTerminal += got
|
||||||
if self.streamToTerminal:
|
if not queued_text:
|
||||||
self.safe_idle_add(self.display_data, terminal)
|
self.safe_idle_add(self.display_data, terminal)
|
||||||
|
|
||||||
if (events & libvirt.VIR_EVENT_HANDLE_WRITABLE and
|
if (events & libvirt.VIR_EVENT_HANDLE_WRITABLE and
|
||||||
|
Loading…
Reference in New Issue
Block a user