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>
This commit is contained in:
Sergio Lopez 2022-09-09 10:12:33 +02:00 committed by Sergio Lopez
parent 610d4ee95c
commit 917e85a3d5
2 changed files with 13 additions and 11 deletions

View file

@ -8,16 +8,16 @@ edition = "2018"
license = "Apache-2.0"
[dependencies]
libc = ">=0.2.39"
log = ">=0.4.6"
vhost = { version = "0.4", features = ["vhost-user-slave"] }
libc = "0.2.39"
log = "0.4.17"
vhost = { version = "0.5", features = ["vhost-user-slave"] }
virtio-bindings = "0.1"
virtio-queue = "0.5.0"
vm-memory = {version = ">=0.7", features = ["backend-mmap", "backend-atomic"]}
virtio-queue = "0.6"
vm-memory = { version = "0.9", features = ["backend-mmap", "backend-atomic"] }
vmm-sys-util = "0.10"
[dev-dependencies]
nix = "0.25"
vhost = { version = "0.4", features = ["vhost-user-master", "vhost-user-slave"] }
vm-memory = {version = ">=0.7", features = ["backend-mmap", "backend-atomic", "backend-bitmap"]}
vhost = { version = "0.5", features = ["vhost-user-master", "vhost-user-slave"] }
vm-memory = { version = "0.9", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
tempfile = "3.2.0"

View file

@ -220,7 +220,7 @@ where
{
fn set_owner(&mut self) -> VhostUserResult<()> {
if self.owned {
return Err(VhostUserError::InvalidOperation);
return Err(VhostUserError::InvalidOperation("already claimed"));
}
self.owned = true;
Ok(())
@ -456,7 +456,9 @@ where
// This request should be handled only when VHOST_USER_F_PROTOCOL_FEATURES
// has been negotiated.
if self.acked_features & VhostUserVirtioFeatures::PROTOCOL_FEATURES.bits() == 0 {
return Err(VhostUserError::InvalidOperation);
return Err(VhostUserError::InvalidOperation(
"protocol features not set",
));
} else if index as usize >= self.num_queues {
return Err(VhostUserError::InvalidParam);
}
@ -505,7 +507,7 @@ where
// Assume the backend hasn't negotiated the inflight feature; it
// wouldn't be correct for the backend to do so, as we don't (yet)
// provide a way for it to handle such requests.
Err(VhostUserError::InvalidOperation)
Err(VhostUserError::InvalidOperation("not supported"))
}
fn set_inflight_fd(
@ -513,7 +515,7 @@ where
_inflight: &vhost::vhost_user::message::VhostUserInflight,
_file: File,
) -> VhostUserResult<()> {
Err(VhostUserError::InvalidOperation)
Err(VhostUserError::InvalidOperation("not supported"))
}
fn get_max_mem_slots(&mut self) -> VhostUserResult<u64> {