Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

Commit 917e85a

Browse files
committed
Update dependencies and switch to caret versions
Update libc, log, vhost, virtio-queue and vm-memory dependencies. Also, take this opportunity to specify the dependencies with caret versions. Switching to a newer vhost required some small changes to accommodate the fact that VhostUserError::InvalidOperation now requires an argument. Signed-off-by: Sergio Lopez <slp@redhat.com>
1 parent 610d4ee commit 917e85a

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ edition = "2018"
88
license = "Apache-2.0"
99

1010
[dependencies]
11-
libc = ">=0.2.39"
12-
log = ">=0.4.6"
13-
vhost = { version = "0.4", features = ["vhost-user-slave"] }
11+
libc = "0.2.39"
12+
log = "0.4.17"
13+
vhost = { version = "0.5", features = ["vhost-user-slave"] }
1414
virtio-bindings = "0.1"
15-
virtio-queue = "0.5.0"
16-
vm-memory = {version = ">=0.7", features = ["backend-mmap", "backend-atomic"]}
15+
virtio-queue = "0.6"
16+
vm-memory = { version = "0.9", features = ["backend-mmap", "backend-atomic"] }
1717
vmm-sys-util = "0.10"
1818

1919
[dev-dependencies]
2020
nix = "0.25"
21-
vhost = { version = "0.4", features = ["vhost-user-master", "vhost-user-slave"] }
22-
vm-memory = {version = ">=0.7", features = ["backend-mmap", "backend-atomic", "backend-bitmap"]}
21+
vhost = { version = "0.5", features = ["vhost-user-master", "vhost-user-slave"] }
22+
vm-memory = { version = "0.9", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
2323
tempfile = "3.2.0"

src/handler.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ where
220220
{
221221
fn set_owner(&mut self) -> VhostUserResult<()> {
222222
if self.owned {
223-
return Err(VhostUserError::InvalidOperation);
223+
return Err(VhostUserError::InvalidOperation("already claimed"));
224224
}
225225
self.owned = true;
226226
Ok(())
@@ -456,7 +456,9 @@ where
456456
// This request should be handled only when VHOST_USER_F_PROTOCOL_FEATURES
457457
// has been negotiated.
458458
if self.acked_features & VhostUserVirtioFeatures::PROTOCOL_FEATURES.bits() == 0 {
459-
return Err(VhostUserError::InvalidOperation);
459+
return Err(VhostUserError::InvalidOperation(
460+
"protocol features not set",
461+
));
460462
} else if index as usize >= self.num_queues {
461463
return Err(VhostUserError::InvalidParam);
462464
}
@@ -505,15 +507,15 @@ where
505507
// Assume the backend hasn't negotiated the inflight feature; it
506508
// wouldn't be correct for the backend to do so, as we don't (yet)
507509
// provide a way for it to handle such requests.
508-
Err(VhostUserError::InvalidOperation)
510+
Err(VhostUserError::InvalidOperation("not supported"))
509511
}
510512

511513
fn set_inflight_fd(
512514
&mut self,
513515
_inflight: &vhost::vhost_user::message::VhostUserInflight,
514516
_file: File,
515517
) -> VhostUserResult<()> {
516-
Err(VhostUserError::InvalidOperation)
518+
Err(VhostUserError::InvalidOperation("not supported"))
517519
}
518520

519521
fn get_max_mem_slots(&mut self) -> VhostUserResult<u64> {

0 commit comments

Comments
 (0)