scst_vdisk, CD-ROM: Change error code returned if no medium present

If my interpretation of section "6.37 TEST UNIT READY command" in SPC-4
is correct then TEST UNIT READY should report "MEDIUM NOT PRESENT" if no
medium is present instead of "LOGICAL UNIT NOT READY, AUXILIARY MEMORY
NOT ACCESSIBLE".

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4307 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-05-18 02:56:13 +00:00
parent e28130bb2f
commit d0af97d3f1
2 changed files with 4 additions and 3 deletions
+3 -1
View File
@@ -241,7 +241,8 @@ enum scst_cdb_flags {
/*************************************************************
** Sense data for the appropriate errors. Can be used with
** scst_set_cmd_error()
** scst_set_cmd_error(). Column order: key, ASC, ASCQ. See
** also http://www.t10.org/lists/asc-num.htm.
*************************************************************/
#define scst_sense_no_sense NO_SENSE, 0x00, 0
#define scst_sense_hardw_error HARDWARE_ERROR, 0x44, 0
@@ -264,6 +265,7 @@ enum scst_cdb_flags {
#define scst_sense_read_error MEDIUM_ERROR, 0x11, 0
#define scst_sense_write_error MEDIUM_ERROR, 0x03, 0
#define scst_sense_not_ready NOT_READY, 0x04, 0x10
#define scst_sense_no_medium NOT_READY, 0x3a, 0
#define scst_sense_invalid_message ILLEGAL_REQUEST, 0x49, 0
#define scst_sense_cleared_by_another_ini_UA UNIT_ATTENTION, 0x2F, 0
#define scst_sense_capacity_data_changed UNIT_ATTENTION, 0x2A, 0x9
+1 -2
View File
@@ -1821,8 +1821,7 @@ static int vcdrom_exec(struct scst_cmd *cmd)
if (virt_dev->cdrom_empty && (opcode != INQUIRY)) {
TRACE_DBG("%s", "CDROM empty");
scst_set_cmd_error(cmd,
SCST_LOAD_SENSE(scst_sense_not_ready));
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_no_medium));
goto out_done;
}