diff --git a/vhost-device-scsi/README.md b/vhost-device-scsi/README.md index 515d7b9..aaaf152 100644 --- a/vhost-device-scsi/README.md +++ b/vhost-device-scsi/README.md @@ -16,7 +16,7 @@ Run QEMU: qemu-system-x86_64 ... \ -device vhost-user-scsi-pci,num_queues=1,param_change=off,chardev=vus \ -chardev socket,id=vus,path=/tmp/vhost-user-scsi.sock \ - # must match total guest meory + # must match total guest memory -object memory-backend-memfd,id=mem,size=384M,share=on \ -numa node,memdev=mem ``` diff --git a/vhost-device-scsi/src/scsi/emulation/block_device.rs b/vhost-device-scsi/src/scsi/emulation/block_device.rs index 7ac4884..e536073 100644 --- a/vhost-device-scsi/src/scsi/emulation/block_device.rs +++ b/vhost-device-scsi/src/scsi/emulation/block_device.rs @@ -758,7 +758,7 @@ impl LogicalUnit for BlockDevice { Ok(CmdOutput::ok()) } SenseFormat::Descriptor => { - // Don't support desciptor format. + // Don't support descriptor format. Ok(CmdOutput::check_condition(sense::INVALID_FIELD_IN_CDB)) } } diff --git a/vhost-device-scsi/src/scsi/emulation/command.rs b/vhost-device-scsi/src/scsi/emulation/command.rs index 43cb0b4..3694fdf 100644 --- a/vhost-device-scsi/src/scsi/emulation/command.rs +++ b/vhost-device-scsi/src/scsi/emulation/command.rs @@ -512,7 +512,7 @@ impl Cdb { let evpd = match cdb[1] { 0 => false, 1 => true, - // obselete or reserved bits set + // obsolete or reserved bits set _ => return Err(ParseError::InvalidField), }; let page_code_raw = cdb[2]; diff --git a/vhost-device-scsi/src/scsi/emulation/missing_lun.rs b/vhost-device-scsi/src/scsi/emulation/missing_lun.rs index cb94baa..72c6760 100644 --- a/vhost-device-scsi/src/scsi/emulation/missing_lun.rs +++ b/vhost-device-scsi/src/scsi/emulation/missing_lun.rs @@ -49,7 +49,7 @@ impl LogicalUnit for MissingLun { Ok(CmdOutput::ok()) } SenseFormat::Descriptor => { - // Don't support desciptor format. + // Don't support descriptor format. Ok(CmdOutput::check_condition(sense::INVALID_FIELD_IN_CDB)) } } diff --git a/vhost-device-scsi/src/scsi/emulation/response_data.rs b/vhost-device-scsi/src/scsi/emulation/response_data.rs index 352d069..0a4d1a4 100644 --- a/vhost-device-scsi/src/scsi/emulation/response_data.rs +++ b/vhost-device-scsi/src/scsi/emulation/response_data.rs @@ -73,7 +73,7 @@ pub fn respond_standard_inquiry_data(data_in: &mut impl Write) -> io::Result<()> // bits: don't support NormACA, support modern LUN format // INQUIRY data version 2 0b0001_0000 | 0x2, - 91, // additional INQURIY data length + 91, // additional INQUIRY data length // bunch of feature bits we don't support: 0, 0, diff --git a/vhost-device-scsi/src/scsi/emulation/tests/bad_lun.rs b/vhost-device-scsi/src/scsi/emulation/tests/bad_lun.rs index 38b7e4a..28ffcee 100644 --- a/vhost-device-scsi/src/scsi/emulation/tests/bad_lun.rs +++ b/vhost-device-scsi/src/scsi/emulation/tests/bad_lun.rs @@ -50,8 +50,8 @@ fn test_report_luns_empty() { target.add_lun(Box::new(dev)); } - // well-known only and several modes explictly defined to return an empty list - // for all but ceratin types of recieving LUNs + // well-known only and several modes explicitly defined to return an empty list + // for all but ceratin types of receiving LUNs let select_reports = &[0x1, 0x10, 0x11, 0x12]; for &sr in select_reports { diff --git a/vhost-device-scsi/src/scsi/emulation/tests/generic.rs b/vhost-device-scsi/src/scsi/emulation/tests/generic.rs index 0ae1728..278c1e5 100644 --- a/vhost-device-scsi/src/scsi/emulation/tests/generic.rs +++ b/vhost-device-scsi/src/scsi/emulation/tests/generic.rs @@ -36,7 +36,7 @@ fn test_invalid_service_action() { do_command_fail( &mut target, &[ - 0xa3, // MAINTAINANCE IN + 0xa3, // MAINTENANCE IN 0x1f, // vendor specific, unused by us 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], diff --git a/vhost-device-scsi/src/scsi/emulation/tests/mod.rs b/vhost-device-scsi/src/scsi/emulation/tests/mod.rs index 33e1461..c1d9a6f 100644 --- a/vhost-device-scsi/src/scsi/emulation/tests/mod.rs +++ b/vhost-device-scsi/src/scsi/emulation/tests/mod.rs @@ -447,7 +447,7 @@ fn test_inquiry() { &[], // some empty comments to get rustfmt to do something vaguely sensible &[ - 0, // accessible; direct acccess block device + 0, // accessible; direct access block device 0, // features 0x7, // version 0x12, // response data format v2, HiSup = 1 diff --git a/vhost-device-scsi/src/scsi/sense.rs b/vhost-device-scsi/src/scsi/sense.rs index ad7da96..bb8a2db 100644 --- a/vhost-device-scsi/src/scsi/sense.rs +++ b/vhost-device-scsi/src/scsi/sense.rs @@ -14,8 +14,8 @@ impl SenseTriple { 0x0, 0x0, 0x0, 0x0, // cmd-specific information self.1, // asc self.2, // ascq - 0x0, // field-replacable unit code - 0x0, 0x0, 0x0, // sense-key-sepcific information + 0x0, // field-replaceable unit code + 0x0, 0x0, 0x0, // sense-key-specific information ] } } diff --git a/vhost-device-scsi/src/vhu_scsi.rs b/vhost-device-scsi/src/vhu_scsi.rs index 78931bd..382c307 100644 --- a/vhost-device-scsi/src/vhu_scsi.rs +++ b/vhost-device-scsi/src/vhu_scsi.rs @@ -142,7 +142,7 @@ impl VhostUserScsiBackend { } Err(RequestParseError::CouldNotReadGuestMemory(e)) => { // See comment later about errors while writing to guest mem; maybe we at least - // got functional write desciptors, so we can report an error + // got functional write descriptors, so we can report an error error!("Error reading request from guest memory: {:?}", e); Response::error(ResponseCode::Failure, body_writer.residual()) } diff --git a/vhost-device-scsi/src/virtio.rs b/vhost-device-scsi/src/virtio.rs index e3074f0..f9915a7 100644 --- a/vhost-device-scsi/src/virtio.rs +++ b/vhost-device-scsi/src/virtio.rs @@ -183,7 +183,7 @@ where .current .is_some_and(|current| self.offset >= current.len()) { - let current = self.current.expect("loop condition ensures existance"); + let current = self.current.expect("loop condition ensures existence"); self.offset -= current.len(); self.current = self.iter.next(); }