Commit 610e213f authored by Thomas Schmitt's avatar Thomas Schmitt

Putting out more info in case of failed Linux SG_IO ioctl

parent 4d5486ac
#define Cdrskin_timestamP "2019.04.13.173610"
#define Cdrskin_timestamP "2019.04.17.085941"
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2014 Thomas Schmitt <scdbackup@gmx.net>
Copyright (c) 2006 - 2019 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
......@@ -2042,7 +2042,7 @@ static void react_on_drive_loss(struct burn_drive *d, struct command *c,
*/
int sg_issue_command(struct burn_drive *d, struct command *c)
{
int done = 0, no_c_page = 0, i, ret;
int done = 0, no_c_page = 0, i, j, ret;
int err;
time_t start_time;
sg_io_hdr_t s;
......@@ -2199,6 +2199,24 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
(unsigned int) s.host_status,
(unsigned int) s.driver_status);
scsi_log_message(d, fp, msg, 0);
libdax_msgs_submit(libdax_messenger,
d->global_index, 0x0002010c,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
msg, 0, 0);
sprintf(msg, "Attempted command: %s : ",
spc_command_name(
(unsigned int) c->opcode[0], 0));
for (j = 0; j <16 && j < c->oplen; j++)
sprintf(msg + strlen(msg), "%2.2x ",
c->opcode[j]);
sprintf(msg + strlen(msg), " : dxfer_len= %d",
s.dxfer_len);
libdax_msgs_submit(libdax_messenger,
d->global_index, 0x0002010c,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
msg, 0, 0);
react_on_drive_loss(d, c, fp);
{ret = -1; goto ex;}
}
......
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2016 Thomas Schmitt <scdbackup@gmx.net>
Copyright (c) 2006 - 2019 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
......@@ -1720,6 +1720,13 @@ static char *scsi_command_name(unsigned int c, int flag)
}
/* ts B90206: Avoid publishing more inner API functions which begin by scsi_ */
char *spc_command_name(unsigned int c, int flag)
{
return(scsi_command_name(c, flag));
}
/* ts A61030 - A61115 */
/* @param flag bit0= do report conditions which are considered not an error
bit1= report with severity FAILURE rather than DEBUG
......
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2014 Thomas Schmitt <scdbackup@gmx.net>
Copyright (c) 2006 - 2019 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
......@@ -114,6 +114,9 @@ int scsi_log_message(struct burn_drive *d, void *fp, char * msg, int flag);
int spc_decode_sense(unsigned char *sense, int senselen,
int *key, int *asc, int *ascq);
/* ts B90206 */
char *spc_command_name(unsigned int c, int flag);
/* ts B00808 */
/** Evaluates outcome of a single SCSI command, eventually logs sense data,
and issues DEBUG error message in case the command is evaluated as done.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment