rust-vmm / vhost-user-backend

Deprecated repository, code now lives in: https://github.com/rust-vmm/vhost/
Apache License 2.0
18 stars 16 forks source link

Build failing because of unsafe call to function #43

Closed andreeaflorescu closed 2 years ago

andreeaflorescu commented 2 years ago

The build fails with the following error:

error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
   --> cargo/git/checkouts/vhost-1b8454ea45823bbf/e4ba734/src/vhost_user/connection.rs:303:26
    |
303 |         let (bytes, _) = self.sock.recv_with_fds(&mut iovs, &mut [])?;
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function

We should mark the call as unsafe and specify why is the way we are calling this function safe.

slp commented 2 years ago

Hm... but that error is coming from https://github.com/rust-vmm/vhost. It also seems to be a vhost from a version < 0.2, which is weird because right now we depend on that one:

vhost = { version = "0.2", features = ["vhost-user-slave"] }
jiangliu commented 2 years ago

Hm... but that error is coming from https://github.com/rust-vmm/vhost. It also seems to be a vhost from a version < 0.2, which is weird because right now we depend on that one:

vhost = { version = "0.2", features = ["vhost-user-slave"] }

I can't reproduce the build failure locally too. Both vhost and vhost-user-backend builds sucessfully.

andreeaflorescu commented 2 years ago

@jiangliu Can you delete the Cargo.lock file and then try to build it? This problem only pops up when updating vmm-sys-util to v0.9.0.

jiangliu commented 2 years ago

@andreeaflorescu I have tried it this: 1) rm Cargo.lock in vhost-user-backend 2) "cargo test --all-features" succeeds 3) "cargo tree" shows that "vmm-sys-util v0.9" is used

andreeaflorescu commented 2 years ago

Right, I had an older version locally :laughing: Closing this.