Skip to content

Commit 9d0b938

Browse files
committed
chore: better panic messages
Add info about queue len and actual size to the message. Signed-off-by: Egor Lazarchuk <[email protected]>
1 parent fa022da commit 9d0b938

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vmm/src/devices/virtio/queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ impl Queue {
333333
// We are choosing to interrupt execution since this could be a potential malicious
334334
// driver scenario. This way we also eliminate the risk of repeatedly
335335
// logging and potentially clogging the microVM through the log system.
336-
panic!("The number of available virtio descriptors is greater than queue size!");
336+
panic!("The number of available virtio descriptors {len} is greater than queue size: {}!", self.actual_size());
337337
}
338338

339339
if len == 0 {
@@ -514,7 +514,7 @@ impl Queue {
514514
// driver scenario. This way we also eliminate the risk of
515515
// repeatedly logging and potentially clogging the microVM through
516516
// the log system.
517-
panic!("The number of available virtio descriptors is greater than queue size!");
517+
panic!("The number of available virtio descriptors {len} is greater than queue size: {}!", self.actual_size());
518518
}
519519
return false;
520520
}

0 commit comments

Comments
 (0)