Skip to content

Commit 91a6256

Browse files
uran0sHstefano-garzarella
authored andcommitted
chore: bump virtio-queue and some related dependencies
virtio-queue v0.15 introduces a new Descriptor API supporting both split and packed virtqueue. Update our dependencies and code to work with the new version of the crate, including updating vhost-user-backend and virtio-vsock. Updates `vhost-user-backend` from 0.18.0 to 0.19.0 - [Release notes](https://github.com/rust-vmm/vhost/releases) - [Commits](rust-vmm/[email protected]) Updates `virtio-queue` from 0.14.0 to 0.15.0 - [Release notes](https://github.com/rust-vmm/vm-virtio/releases) - [Commits](rust-vmm/[email protected]) Updates `virtio-vsock` from 0.8.0 to 0.9.0 - [Release notes](https://github.com/rust-vmm/vm-virtio/releases) - [Commits](rust-vmm/[email protected]) Signed-off-by: Wenyu Huang <[email protected]>
1 parent 3e98e89 commit 91a6256

File tree

34 files changed

+377
-238
lines changed

34 files changed

+377
-238
lines changed

Cargo.lock

Lines changed: 23 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/Cargo.lock

Lines changed: 9 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/vhost-device-video/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ libc = "0.2.172"
2727
thiserror = "2.0"
2828
futures-executor = { version = "0.3", features = ["thread-pool"] }
2929
vhost = { version = "0.14", features = ["vhost-user-backend"] }
30-
vhost-user-backend = "0.18"
30+
vhost-user-backend = "0.19"
3131
virtio-bindings = "0.2.5"
32-
virtio-queue = "0.14"
32+
virtio-queue = "0.15"
3333
vm-memory = "0.16.0"
3434
vmm-sys-util = "0.14"
3535
v4l2r = { git = "https://github.com/Gnurou/v4l2r", rev = "110fd77", optional = true }
@@ -38,5 +38,5 @@ v4l2r = { git = "https://github.com/Gnurou/v4l2r", rev = "110fd77", optional =
3838
assert_matches = "1.5"
3939
rstest = "0.25.0"
4040
tempfile = "3.20.0"
41-
virtio-queue = { version = "0.14", features = ["test-utils"] }
41+
virtio-queue = { version = "0.15", features = ["test-utils"] }
4242
vm-memory = { version = "0.16.0", features = ["backend-mmap", "backend-atomic"] }

staging/vhost-device-video/src/vhu_video_thread.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::{
1111
use futures_executor::{ThreadPool, ThreadPoolBuilder};
1212
use log::{debug, warn};
1313
use vhost_user_backend::{VringEpollHandler, VringRwLock, VringT};
14-
use virtio_queue::{Descriptor, QueueOwnedT};
14+
use virtio_queue::{desc::split::Descriptor as SplitDescriptor, QueueOwnedT};
1515
use vm_memory::{
1616
ByteValued, Bytes, GuestAddress, GuestAddressSpace, GuestMemory, GuestMemoryAtomic,
1717
GuestMemoryMmap,
@@ -198,7 +198,7 @@ pub(crate) struct VhostUserVideoThread {
198198

199199
fn write_descriptor_data<T: ToBytes>(
200200
resp: T,
201-
desc_response: &Descriptor,
201+
desc_response: &SplitDescriptor,
202202
desc_chain: &VideoDescriptorChain,
203203
vring: &VringRwLock,
204204
) {
@@ -577,7 +577,7 @@ mod tests {
577577
use rstest::*;
578578
use tempfile::TempDir;
579579
use virtio_bindings::virtio_ring::{VRING_DESC_F_NEXT, VRING_DESC_F_WRITE};
580-
use virtio_queue::{mock::MockSplitQueue, Queue};
580+
use virtio_queue::{desc::RawDescriptor, mock::MockSplitQueue, Queue};
581581
use vm_memory::{Address, GuestAddress};
582582
use vmm_sys_util::eventfd::EventFd;
583583

@@ -605,14 +605,18 @@ mod tests {
605605

606606
// Descriptor for the video request
607607
let desc_request =
608-
Descriptor::new(next_addr, request_size, VRING_DESC_F_NEXT as u16, index + 1);
608+
SplitDescriptor::new(next_addr, request_size, VRING_DESC_F_NEXT as u16, index + 1);
609609
mem.write_slice(request, desc_request.addr()).unwrap();
610-
vq.desc_table().store(index, desc_request).unwrap();
610+
vq.desc_table()
611+
.store(index, RawDescriptor::from(desc_request))
612+
.unwrap();
611613
next_addr += u64::from(desc_request.len());
612614
index += 1;
613615
// Descriptor for the video response
614-
let desc_response = Descriptor::new(next_addr, 0x100, VRING_DESC_F_WRITE as u16, 0);
615-
vq.desc_table().store(index, desc_response).unwrap();
616+
let desc_response = SplitDescriptor::new(next_addr, 0x100, VRING_DESC_F_WRITE as u16, 0);
617+
vq.desc_table()
618+
.store(index, RawDescriptor::from(desc_response))
619+
.unwrap();
616620

617621
// Put the descriptor index 0 in the first available ring position.
618622
mem.write_obj(0u16, vq.avail_addr().unchecked_add(4))

staging/vhost-device-video/src/video.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,11 @@ impl ToBytes for virtio_video_event {
946946
pub mod tests {
947947
use assert_matches::assert_matches;
948948
use rstest::*;
949-
use virtio_queue::{mock::MockSplitQueue, Descriptor, Queue, QueueOwnedT};
949+
use virtio_queue::{
950+
desc::{split::Descriptor as SplitDescriptor, RawDescriptor},
951+
mock::MockSplitQueue,
952+
Queue, QueueOwnedT,
953+
};
950954
use vm_memory::{
951955
Address, Bytes, GuestAddress, GuestAddressSpace, GuestMemoryAtomic, GuestMemoryMmap,
952956
};
@@ -961,9 +965,12 @@ pub mod tests {
961965
let flags = 0;
962966

963967
let request = request.as_slice();
964-
let desc = Descriptor::new(addr, request.len() as u32, flags as u16, 1);
968+
let desc = SplitDescriptor::new(addr, request.len() as u32, flags as u16, 1);
965969
mem.write(request, desc.addr()).unwrap();
966-
assert!(virt_queue.desc_table().store(0, desc).is_ok());
970+
assert!(virt_queue
971+
.desc_table()
972+
.store(0, RawDescriptor::from(desc))
973+
.is_ok());
967974

968975
// Put the descriptor index 0 in the first available ring position.
969976
mem.write_obj(0u16, virt_queue.avail_addr().unchecked_add(4))

vhost-device-can/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ thiserror = "2.0"
2222
queues = "1.0.2"
2323
socketcan = "3.5.0"
2424
vhost = { version = "0.14", features = ["vhost-user-backend"] }
25-
vhost-user-backend = "0.18"
25+
vhost-user-backend = "0.19"
2626
virtio-bindings = "0.2.5"
27-
virtio-queue = "0.14"
27+
virtio-queue = "0.15"
2828
vm-memory = "0.16.1"
2929
vmm-sys-util = "0.14"
3030

3131
[dev-dependencies]
3232
assert_matches = "1.5"
33-
virtio-queue = { version = "0.14", features = ["test-utils"] }
33+
virtio-queue = { version = "0.15", features = ["test-utils"] }
3434
vm-memory = { version = "0.16.1", features = ["backend-mmap", "backend-atomic"] }

0 commit comments

Comments
 (0)