Skip to content

Commit c0a978f

Browse files
Copilotjstarks
andcommitted
Address code review: improve comment and error message in new_scsi_dvd
Co-authored-by: jstarks <9548354+jstarks@users.noreply.github.com>
1 parent 0efd788 commit c0a978f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • vm/devices/storage/scsidisk/src/scsidvd

vm/devices/storage/scsidisk/src/scsidvd/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,10 @@ mod tests {
23962396
use zerocopy::IntoBytes;
23972397

23982398
fn new_scsi_dvd(sector_size: u32, sector_count: u64) -> SimpleScsiDvd {
2399+
// The disk is always created writable so the test can pre-fill it with
2400+
// pattern data. The SCSI DVD layer enforces read-only at the command
2401+
// level; these tests exercise DVD protocol behavior, not write
2402+
// protection.
23992403
let disk_size = sector_count * sector_size as u64;
24002404
let disk = disklayer_ram::ram_disk_with_sector_size(disk_size, false, sector_size).unwrap();
24012405

@@ -2406,7 +2410,7 @@ mod tests {
24062410
let buffers = OwnedRequestBuffers::linear(0, pattern.len(), false);
24072411
disk.write_vectored(&buffers.buffer(&mem), 0, false)
24082412
.now_or_never()
2409-
.expect("RAM disk write should not block")
2413+
.expect("RAM disk write should complete synchronously")
24102414
.unwrap();
24112415

24122416
let scsi_dvd = SimpleScsiDvd::new(Some(disk));

0 commit comments

Comments
 (0)