@@ -333,7 +333,10 @@ impl Queue {
333
333
// We are choosing to interrupt execution since this could be a potential malicious
334
334
// driver scenario. This way we also eliminate the risk of repeatedly
335
335
// 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 ! (
337
+ "The number of available virtio descriptors {len} is greater than queue size: {}!" ,
338
+ self . actual_size( )
339
+ ) ;
337
340
}
338
341
339
342
if len == 0 {
@@ -514,7 +517,11 @@ impl Queue {
514
517
// driver scenario. This way we also eliminate the risk of
515
518
// repeatedly logging and potentially clogging the microVM through
516
519
// the log system.
517
- panic ! ( "The number of available virtio descriptors is greater than queue size!" ) ;
520
+ panic ! (
521
+ "The number of available virtio descriptors {len} is greater than queue size: \
522
+ {}!",
523
+ self . actual_size( )
524
+ ) ;
518
525
}
519
526
return false ;
520
527
}
@@ -1292,7 +1299,7 @@ mod tests {
1292
1299
1293
1300
#[ test]
1294
1301
#[ should_panic(
1295
- expected = "The number of available virtio descriptors is greater than queue size!"
1302
+ expected = "The number of available virtio descriptors 5 is greater than queue size: 4 !"
1296
1303
) ]
1297
1304
fn test_invalid_avail_idx_no_notification ( ) {
1298
1305
// This test ensures constructing a descriptor chain succeeds
@@ -1337,7 +1344,7 @@ mod tests {
1337
1344
1338
1345
#[ test]
1339
1346
#[ should_panic(
1340
- expected = "The number of available virtio descriptors is greater than queue size!"
1347
+ expected = "The number of available virtio descriptors 6 is greater than queue size: 4 !"
1341
1348
) ]
1342
1349
fn test_invalid_avail_idx_with_notification ( ) {
1343
1350
// This test ensures constructing a descriptor chain succeeds
0 commit comments