fuzz: block: Ensure the virtio-block thread is killed and joined

This also ensures that the 'queue_evt' is fully processed, as we enforce
the main thread is waiting for the virtio-block thread to process the
'kill_evt' which is after the 'queue_evt' processing.

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2022-08-03 18:30:36 -07:00 committed by Sebastien Boeuf
parent 5ba3b80e83
commit fbec4a070d

View File

@ -114,6 +114,8 @@ fuzz_target!(|bytes| {
queue_evt.write(77).unwrap(); // Rings the doorbell, any byte will do. queue_evt.write(77).unwrap(); // Rings the doorbell, any byte will do.
wait_queue_event_processed(queue_evt); wait_queue_event_processed(queue_evt);
block.reset(); // Ensure the virtio-block device thread is killed and joined
}); });
fn read_u64<T: Read>(readable: &mut T) -> u64 { fn read_u64<T: Read>(readable: &mut T) -> u64 {