Skip to content

Commit a26ca49

Browse files
committed
Remove unused code
1 parent 0c4dd4d commit a26ca49

File tree

1 file changed

+0
-42
lines changed
  • vm/devices/storage/storvsc_driver/src

1 file changed

+0
-42
lines changed

vm/devices/storage/storvsc_driver/src/lib.rs

-42
Original file line numberDiff line numberDiff line change
@@ -660,25 +660,13 @@ struct StorvscCompletionPacket {
660660
data: [u8; storvsp_protocol::SCSI_REQUEST_LEN_MAX],
661661
}
662662

663-
/*#[derive(Debug)]
664-
struct StorvscDataPacket {
665-
transaction_id: u64,
666-
request_size: usize,
667-
operation: storvsp_protocol::Operation,
668-
flags: u32,
669-
status: storvsp_protocol::NtStatus,
670-
data: [u8; storvsp_protocol::SCSI_REQUEST_LEN_MAX],
671-
}*/
672-
673663
fn parse_packet<T: RingMem>(packet: &IncomingPacket<'_, T>) -> Result<Packet, StorvscError> {
674664
match packet {
675665
IncomingPacket::Completion(completion) => {
676666
parse_completion(completion).map_err(StorvscError::PacketError)
677667
}
678668
IncomingPacket::Data(_) => {
679-
// TODO
680669
Err(StorvscError::PacketError(PacketError::InvalidPacketType))
681-
//parse_data(data).map_err(StorvscError::PacketError)
682670
}
683671
}
684672
}
@@ -701,36 +689,6 @@ fn parse_completion<T: RingMem>(packet: &CompletionPacket<'_, T>) -> Result<Pack
701689
}))
702690
}
703691

704-
/*fn parse_data<T: RingMem>(packet: &IncomingPacket<'_, T>) -> Result<Packet, PacketError> {
705-
let packet = match packet {
706-
IncomingPacket::Completion(_) => return Err(PacketError::InvalidPacketType),
707-
IncomingPacket::Data(packet) => packet,
708-
};
709-
let transaction_id = packet.transaction_id();
710-
711-
let mut reader = packet.reader();
712-
let header: storvsp_protocol::Packet = reader.read_plain().map_err(PacketError::Access)?;
713-
// You would expect that this should be limited to the current protocol
714-
// version's maximum packet size, but this is not what Hyper-V does, and
715-
// Linux 6.1 relies on this behavior during protocol initialization.
716-
let request_size = reader.len().min(storvsp_protocol::SCSI_REQUEST_LEN_MAX);
717-
let operation = header.operation;
718-
let flags = header.flags;
719-
let status = header.status;
720-
721-
let mut data = [0_u8; storvsp_protocol::SCSI_REQUEST_LEN_MAX];
722-
reader.read(&mut data).map_err(PacketError::Access)?;
723-
724-
Ok(Packet {
725-
transaction_id,
726-
request_size,
727-
operation,
728-
flags,
729-
status,
730-
data,
731-
})
732-
}*/
733-
734692
fn expect_success(packet: StorvscCompletionPacket) -> Result<StorvscCompletionPacket, PacketError> {
735693
if packet.status != storvsp_protocol::NtStatus::SUCCESS {
736694
return Err(PacketError::UnexpectedStatus(packet.status));

0 commit comments

Comments
 (0)