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.cb(data.timer, data.opaque)
|
||||
|
||||
return True
|
||||
|
||||
def glib_event_timeout_add(interval, cb, opaque):
|
||||
data = EventTimer()
|
||||
|
||||
|
@ -145,7 +145,7 @@ class LibvirtConsoleConnection(ConsoleConnection):
|
||||
|
||||
if events & libvirt.VIR_EVENT_HANDLE_READABLE:
|
||||
try:
|
||||
got = self.stream.recv(1024)
|
||||
got = self.stream.recv(1024 * 100)
|
||||
except:
|
||||
logging.exception("Error receiving stream data")
|
||||
self.close()
|
||||
@ -154,8 +154,9 @@ class LibvirtConsoleConnection(ConsoleConnection):
|
||||
if got == -2:
|
||||
return
|
||||
|
||||
queued_text = bool(self.streamToTerminal)
|
||||
self.streamToTerminal += got
|
||||
if self.streamToTerminal:
|
||||
if not queued_text:
|
||||
self.safe_idle_add(self.display_data, terminal)
|
||||
|
||||
if (events & libvirt.VIR_EVENT_HANDLE_WRITABLE and
|
||||
|
Loading…
Reference in New Issue
Block a user