File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/vmm/src/devices/virtio Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,8 @@ impl IoVecBuffer {
217217/// of data from that buffer.
218218#[ derive( Debug , Default , Clone ) ]
219219pub struct IoVecBufferMut {
220+ // Index of the head desciptor
221+ head_index : u16 ,
220222 // container of the memory regions included in this IO vector
221223 vecs : IoVecVec ,
222224 // Total length of the IoVecBufferMut
@@ -234,6 +236,7 @@ impl IoVecBufferMut {
234236 head : DescriptorChain ,
235237 ) -> Result < ( ) , IoVecError > {
236238 self . clear ( ) ;
239+ self . head_index = head. index ;
237240
238241 let mut next_descriptor = Some ( head) ;
239242 while let Some ( desc) = next_descriptor {
@@ -422,6 +425,7 @@ mod tests {
422425 impl From < & mut [ u8 ] > for IoVecBufferMut {
423426 fn from ( buf : & mut [ u8 ] ) -> Self {
424427 Self {
428+ head_index : 0 ,
425429 vecs : vec ! [ iovec {
426430 iov_base: buf. as_mut_ptr( ) . cast:: <c_void>( ) ,
427431 iov_len: buf. len( ) ,
@@ -733,7 +737,12 @@ mod verification {
733737 } ;
734738
735739 let ( vecs, len) = create_iovecs ( mem, GUEST_MEMORY_SIZE ) ;
736- Self { vecs, len }
740+ let head_index = kani:: any ( ) ;
741+ Self {
742+ head_index,
743+ vecs,
744+ len,
745+ }
737746 }
738747 }
739748
You can’t perform that action at this time.
0 commit comments