mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 07:21:15 +00:00
vm-virtio: Improve virtio-console input processing
The way the code is currently implemented, only by writing to STDIN a user can trigger some input to reach the VM through virtio-console. But in case, there were not enough virtio descriptors to process what was retrieved from STDIN, the remaining bits would be transferred only if STDIN was triggered again. The missing part is that when some descriptors are made available from the guest, the virtio-console device should try to send any possible remaining bits. By triggering the function process_input_queue() whenever the guest notifies the host that some new descriptors are ready for the receive queue, this patch allows to fill the implementation void that was left. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
e4c3401a33
commit
38468d3d9b
@ -231,6 +231,11 @@ impl ConsoleEpollHandler {
|
|||||||
if let Err(e) = self.input_queue_evt.read() {
|
if let Err(e) = self.input_queue_evt.read() {
|
||||||
error!("Failed to get queue event: {:?}", e);
|
error!("Failed to get queue event: {:?}", e);
|
||||||
break 'epoll;
|
break 'epoll;
|
||||||
|
} else if self.process_input_queue() {
|
||||||
|
if let Err(e) = self.signal_used_queue() {
|
||||||
|
error!("Failed to signal used queue: {:?}", e);
|
||||||
|
break 'epoll;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OUTPUT_QUEUE_EVENT => {
|
OUTPUT_QUEUE_EVENT => {
|
||||||
|
Loading…
Reference in New Issue
Block a user