vhost-user: Wait for full request to be satisfied
The recvmsg syscall can split a request in multiple packets unless we use the flag MSG_WAITALL to make sure the request will wait for the whole data to be transferred before returning. This flag is needed to prevent the vhost crate from returning the error PartialMessage, which occured sporadically when using virtio-fs, and which was detected as part of our continuous integration testing. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
e2d4c8686b
commit
37414831aa
1 changed files with 1 additions and 1 deletions
|
|
@ -176,7 +176,7 @@ fn raw_recvmsg(fd: RawFd, iovecs: &mut [iovec], in_fds: &mut [RawFd]) -> Result<
|
|||
|
||||
// Safe because the msghdr was properly constructed from valid (or null) pointers of the
|
||||
// indicated length and we check the return value.
|
||||
let total_read = unsafe { recvmsg(fd, &mut msg, 0) };
|
||||
let total_read = unsafe { recvmsg(fd, &mut msg, libc::MSG_WAITALL) };
|
||||
|
||||
if total_read == -1 {
|
||||
return Err(Error::last());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue