Skip to content

Commit 23551b8

Browse files
committed
WIP
Signed-off-by: Babis Chalios <[email protected]>
1 parent e557c8d commit 23551b8

File tree

6 files changed

+211
-135
lines changed

6 files changed

+211
-135
lines changed

resources/seccomp/aarch64-unknown-linux-musl.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
"syscall": "writev",
3333
"comment": "Used by the VirtIO net device to write to tap"
3434
},
35+
{
36+
"syscall": "readv",
37+
"comment": "Used by the VirtIO net device to write from tap"
38+
},
3539
{
3640
"syscall": "fsync"
3741
},

resources/seccomp/x86_64-unknown-linux-musl.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
"syscall": "writev",
3333
"comment": "Used by the VirtIO net device to write to tap"
3434
},
35+
{
36+
"syscall": "readv",
37+
"comment": "Used by the VirtIO net device to read from tap"
38+
},
3539
{
3640
"syscall": "fsync"
3741
},

src/vmm/src/devices/virtio/iovec.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,23 @@ mod tests {
517517
}
518518
}
519519

520+
impl<'a> From<Vec<&'a mut [u8]>> for IoVecBufferMut<'a> {
521+
fn from(mut buffer: Vec<&'a mut [u8]>) -> Self {
522+
let mut len = 0usize;
523+
let mut vecs = IovDeque::new().unwrap();
524+
buffer.drain(..).for_each(|slice| {
525+
len += slice.len();
526+
527+
vecs.push_back(iovec {
528+
iov_base: slice.as_ptr() as *mut c_void,
529+
iov_len: slice.len(),
530+
});
531+
});
532+
533+
Self { vecs, len }
534+
}
535+
}
536+
520537
fn default_mem() -> GuestMemoryMmap {
521538
multi_region_mem(&[
522539
(GuestAddress(0), 0x10000),

0 commit comments

Comments
 (0)