Skip to content

Commit e800a14

Browse files
committed
Inflight I/O: Fix queue region header layout
As defined in the vhost-user protocol[1], the last field of queue region header should be a zero-sized array. However, current implementation uses u64, which will cause a wrong inflight I/O memfd memory layout. So, let's just remove the desc fileds to fix it. [1] https://qemu-project.gitlab.io/qemu/interop/vhost-user.html#inflight-i-o-tracking Signed-off-by: Jiachen Zhang <[email protected]>
1 parent 38fae60 commit e800a14

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/vhost_user/message.rs

-6
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,6 @@ pub struct QueueRegionSplit {
877877
pub last_batch_head: u16,
878878
/// Idx value of used ring
879879
pub used_idx: u16,
880-
/// Pointer to an array of DescStateSplit entries
881-
pub desc: u64,
882880
}
883881

884882
impl QueueRegionSplit {
@@ -890,7 +888,6 @@ impl QueueRegionSplit {
890888
desc_num: queue_size,
891889
last_batch_head: 0,
892890
used_idx: 0,
893-
desc: 0,
894891
}
895892
}
896893
}
@@ -951,8 +948,6 @@ pub struct QueueRegionPacked {
951948
pub old_used_wrap_counter: u8,
952949
/// Padding
953950
padding: [u8; 7],
954-
/// Pointer to array tracking state of each descriptor from descriptor ring
955-
pub desc: u64,
956951
}
957952

958953
impl QueueRegionPacked {
@@ -969,7 +964,6 @@ impl QueueRegionPacked {
969964
used_wrap_counter: 0,
970965
old_used_wrap_counter: 0,
971966
padding: [0; 7],
972-
desc: 0,
973967
}
974968
}
975969
}

0 commit comments

Comments
 (0)