mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-22 04:25:21 +00:00
virtio-devices: Pass negotiated queue size to vhost-user backend
The vhost-user backend was always provided the maximum queue size but this is incorrect. Instead it must be informed of the actual queue size that has been negotiated with the virtio driver running in the guest. This ensures proper functioning of vhost-user-block with the Rust Hypervisor Firmware, which uses a hardcoded queue size of 16. Partially fixes #4285 Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
00800b8499
commit
f94a5fb4e3
@ -173,7 +173,7 @@ impl VhostUserHandle {
|
||||
// at early stage.
|
||||
for (queue_index, queue) in queues.iter().enumerate() {
|
||||
self.vu
|
||||
.set_vring_num(queue_index, queue.max_size())
|
||||
.set_vring_num(queue_index, queue.state.size)
|
||||
.map_err(Error::VhostUserSetVringNum)?;
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ impl VhostUserHandle {
|
||||
mmap_size: 0,
|
||||
mmap_offset: 0,
|
||||
num_queues: queues.len() as u16,
|
||||
queue_size: queues[0].max_size(),
|
||||
queue_size: queues[0].state.size,
|
||||
};
|
||||
let (info, fd) = self
|
||||
.vu
|
||||
@ -203,11 +203,11 @@ impl VhostUserHandle {
|
||||
|
||||
let mut vrings_info = Vec::new();
|
||||
for (queue_index, queue) in queues.into_iter().enumerate() {
|
||||
let actual_size: usize = queue.max_size().try_into().unwrap();
|
||||
let actual_size: usize = queue.state.size.try_into().unwrap();
|
||||
|
||||
let config_data = VringConfigData {
|
||||
queue_max_size: queue.max_size(),
|
||||
queue_size: queue.max_size(),
|
||||
queue_size: queue.state.size,
|
||||
flags: 0u32,
|
||||
desc_table_addr: get_host_address_range(
|
||||
mem,
|
||||
|
Loading…
x
Reference in New Issue
Block a user