Skip to content

Commit

Permalink
Update EOM handling when hitting end-of-data while spacing for filemark
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Dec 9, 2024
1 parent 87cb802 commit 61c931d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cpp/devices/tape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,11 @@ SimhMetaData Tape::FindNextObject(object_type type, int32_t requested_count, boo
void Tape::RaiseBeginningOfPartition(int64_t info)
{
LogTrace("Encountered beginning-of-partition while reverse-spacing");

ResetPositions();
SetInformation(info);
SetEom(ascq::beginning_of_partition_medium_detected);

throw scsi_exception(sense_key::no_sense);
}

Expand All @@ -712,7 +714,6 @@ void Tape::RaiseEndOfData(object_type type, int64_t info)
static_cast<int>(type)));

SetInformation(info);
SetEom(ascq::end_of_data_detected);

throw scsi_exception(sense_key::blank_check, asc::no_additional_sense_information);
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/tape_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ TEST(TapeTest, Space6_simh)
controller->SetCdbByte(4, 1);
Dispatch(tape, scsi_command::space_6, sense_key::blank_check);
RequestSense(controller, tape);
EXPECT_EQ(ascq::end_of_data_detected, static_cast<ascq>(controller->GetBuffer()[13]));
EXPECT_NE(ascq::end_of_data_detected, static_cast<ascq>(controller->GetBuffer()[13]));
EXPECT_TRUE(controller->GetBuffer()[0] & 0x80);
EXPECT_EQ(1U, GetInt32(controller->GetBuffer(), 3));
CheckPositions(tape, 1044, 3);
Expand Down

0 comments on commit 61c931d

Please sign in to comment.