List, Paolo Please find a trivial patch that changes the sense code for errors when trying, and failing, to eject media using the START_STOP_UNIT command when the medium is locked down by a previous PREVENT_ALLOW_MEDIUM_REMOVAL command.
MMC Annex F lists MEDIUM_REMOVAL_PREVENTED as the recommended sense code for this error. This now passes the test that a SCSI target retports the corre3ct sense code(s) for medium removal protection : iscsi-test --dataloss --test="*prevent*eject*" iscsi://127.0.0.1:32601/iqn.qemu.scsi-test/3 0381_preventallow_eject: ======================== Try to set PREVENTALLOW ... [OK] Try to eject the media ... Eject failed. [OK] Load the media again in case it was ejected ... [OK] Clear the PREVENTALLOW again ... [OK] TEST T0381_preventallow_eject [OK] regards ronnie sahlberg