New option -scsi_log

This commit is contained in:
Thomas Schmitt 2010-02-18 12:48:42 +00:00
parent 6a9c99cbd8
commit 4374d984d1
7 changed files with 67 additions and 7 deletions

View File

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Feb 14, 2010" .TH XORRISO 1 "Feb 17, 2010"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
@ -3158,6 +3158,15 @@ Record format is: timestamp start_lba size volume-id
.br .br
The first three items are single words, the rest of the line is the volume id. The first three items are single words, the rest of the line is the volume id.
.TP .TP
\fB\-scsi_log\fR "on"|"off"
Mode "on" enables very verbous logging of SCSI commands and drive replies.
Logging messages get printed to stderr, not to any of the xorriso output
channels.
.br
A special property of this option is that the first -scsi_log setting
among the start arguments is in effect already when the first operations
of xorriso begin. Only "-scsi_log" with dash "-" is recognized that way.
.TP
\fB\-end\fR \fB\-end\fR
.br .br
End program immediately End program immediately

View File

@ -4868,6 +4868,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
} }
m->msglist_stackfill= 0; m->msglist_stackfill= 0;
m->status_history_max= Xorriso_status_history_maX; m->status_history_max= Xorriso_status_history_maX;
m->scsi_log= 0;
strcpy(m->report_about_text, "UPDATE"); strcpy(m->report_about_text, "UPDATE");
Xorriso__text_to_sev(m->report_about_text, &m->report_about_severity, 0); Xorriso__text_to_sev(m->report_about_text, &m->report_about_severity, 0);
m->library_msg_direct_print= 0; m->library_msg_direct_print= 0;
@ -7126,6 +7127,11 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults)) if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (xorriso->scsi_log == 0);
sprintf(line,"-scsi_log %s\n", xorriso->scsi_log ? "on" : "off");
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (xorriso->session_logfile[0]==0); is_default= (xorriso->session_logfile[0]==0);
sprintf(line,"-session_log %s\n", sprintf(line,"-session_log %s\n",
Text_shellsafe(xorriso->session_logfile,sfe,0)); Text_shellsafe(xorriso->session_logfile,sfe,0));
@ -16448,6 +16454,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -session_log path", " -session_log path",
" Set path of a file where a log record gets appended after", " Set path of a file where a log record gets appended after",
" each session. Form: timestamp start_lba size volume-id", " each session. Form: timestamp start_lba size volume-id",
" -scsi_log \"on\"|\"off\"",
" Enable or disable logging of SCSI commands to stderr.",
" # any text Is ignored. In dialog mode the input line will be stored in", " # any text Is ignored. In dialog mode the input line will be stored in",
" the eventual readline history, nevertheless.", " the eventual readline history, nevertheless.",
" -version Tell program and version number", " -version Tell program and version number",
@ -18200,6 +18208,23 @@ int Xorriso_option_scdbackup_tag(struct XorrisO *xorriso, char *listname,
} }
/* Option -scsi_log */
int Xorriso_option_scsi_log(struct XorrisO *xorriso, char *mode, int flag)
{
if(strcmp(mode, "on") == 0)
xorriso->scsi_log= 1;
else if(strcmp(mode, "off") == 0)
xorriso->scsi_log= 0;
else {
sprintf(xorriso->info_text, "-scsi_log: unknown mode '%s'", mode);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
Xorriso_scsi_log(xorriso, !!xorriso->scsi_log);
return(1);
}
/* Option -session_log */ /* Option -session_log */
int Xorriso_option_session_log(struct XorrisO *xorriso, char *path, int flag) int Xorriso_option_session_log(struct XorrisO *xorriso, char *path, int flag)
{ {
@ -19381,7 +19406,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"options_from_file","osirrox","outdev","out_charset","overwrite", "options_from_file","osirrox","outdev","out_charset","overwrite",
"pacifier","padding","path_list","pathspecs","pkt_output","print","prompt", "pacifier","padding","path_list","pathspecs","pkt_output","print","prompt",
"prog","prog_help","publisher","quoted_not_list","quoted_path_list", "prog","prog_help","publisher","quoted_not_list","quoted_path_list",
"reassure","report_about","rom_toc_scan", "reassure","report_about","rom_toc_scan","scsi_log",
"session_log","speed","split_size","status","status_history_max", "session_log","speed","split_size","status","status_history_max",
"stdio_sync","stream_recording","system_id","temp_mem_limit", "stdio_sync","stream_recording","system_id","temp_mem_limit",
"uid","unregister_filter","use_readline","volid","volset_id", "uid","unregister_filter","use_readline","volid","volset_id",
@ -20090,6 +20115,10 @@ next_command:;
(*idx)+= 2; (*idx)+= 2;
ret= Xorriso_option_scdbackup_tag(xorriso, arg1, arg2, 0); ret= Xorriso_option_scdbackup_tag(xorriso, arg1, arg2, 0);
} else if(strcmp(cmd, "scsi_log") == 0) {
(*idx)++;
ret= Xorriso_option_scsi_log(xorriso, arg1, 0);
} else if(strcmp(cmd,"session_log")==0) { } else if(strcmp(cmd,"session_log")==0) {
(*idx)++; (*idx)++;
ret= Xorriso_option_session_log(xorriso, arg1, 0); ret= Xorriso_option_session_log(xorriso, arg1, 0);
@ -20466,19 +20495,19 @@ protect_stdout:;
sprintf(xorriso->info_text, "Disabling use of libreadline."); sprintf(xorriso->info_text, "Disabling use of libreadline.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
} else if(strcmp(cmd,"abort_on")==0 && was_dashed) { } else if(strcmp(cmd,"abort_on")==0 && was_dashed == 1) {
i++; i++;
if(!was_abort_on) if(!was_abort_on)
Xorriso_option_abort_on(xorriso, arg1, 0); Xorriso_option_abort_on(xorriso, arg1, 0);
was_abort_on= 1; was_abort_on= 1;
} else if(strcmp(cmd,"report_about")==0 && was_dashed) { } else if(strcmp(cmd,"report_about")==0 && was_dashed == 1) {
i++; i++;
if(!was_report_about) if(!was_report_about)
Xorriso_option_report_about(xorriso, arg1, 0); Xorriso_option_report_about(xorriso, arg1, 0);
was_report_about= 1; was_report_about= 1;
} else if(strcmp(cmd,"return_with")==0 && was_dashed) { } else if(strcmp(cmd,"return_with")==0 && was_dashed == 1) {
i+= 2; i+= 2;
num2= 0; num2= 0;
sscanf(arg2,"%d",&num2); sscanf(arg2,"%d",&num2);
@ -20486,7 +20515,7 @@ protect_stdout:;
Xorriso_option_return_with(xorriso, arg1, num2, 0); Xorriso_option_return_with(xorriso, arg1, num2, 0);
was_return_with= 1; was_return_with= 1;
} else if(strcmp(cmd,"as")==0 && was_dashed) { } else if(strcmp(cmd,"as")==0 && was_dashed == 1) {
if(strcmp(arg1, "mkisofs")==0 || strcmp(arg1, "genisoimage")==0 || if(strcmp(arg1, "mkisofs")==0 || strcmp(arg1, "genisoimage")==0 ||
strcmp(arg1, "genisofs")==0 || strcmp(arg1, "xorrisofs")==0) strcmp(arg1, "genisofs")==0 || strcmp(arg1, "xorrisofs")==0)
goto protect_stdout; goto protect_stdout;
@ -20498,6 +20527,10 @@ protect_stdout:;
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
} else if(strcmp(cmd, "scsi_log") == 0 && was_dashed == 1) {
i++;
Xorriso_option_scsi_log(xorriso, arg1, 0);
} else { } else {
ret= Xorriso_count_args(xorriso, argc-i, argv+i, &arg_count, 1); ret= Xorriso_count_args(xorriso, argc-i, argv+i, &arg_count, 1);
if(ret==1) if(ret==1)

View File

@ -887,6 +887,8 @@ int Xorriso_option_rom_toc_scan(struct XorrisO *xorriso, char *mode,
/* Option -scdbackup_tag */ /* Option -scdbackup_tag */
int Xorriso_option_scdbackup_tag(struct XorrisO *xorriso, char *list_path, int Xorriso_option_scdbackup_tag(struct XorrisO *xorriso, char *list_path,
char *record_name, int flag); char *record_name, int flag);
/* Option -scsi_log */
int Xorriso_option_scsi_log(struct XorrisO *xorriso, char *mode, int flag);
/* Option -session_log */ /* Option -session_log */
int Xorriso_option_session_log(struct XorrisO *xorriso, char *path, int flag); int Xorriso_option_session_log(struct XorrisO *xorriso, char *path, int flag);

View File

@ -368,6 +368,8 @@ struct XorrisO { /* the global context of xorriso */
int status_history_max; /* for -status long_history */ int status_history_max; /* for -status long_history */
/* 0= no logging of SCSI commands, 1= to stderr */
int scsi_log;
char report_about_text[20]; char report_about_text[20];
int report_about_severity; int report_about_severity;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.02.17.140002" #define Xorriso_timestamP "2010.02.18.125019"

View File

@ -13014,3 +13014,13 @@ int Xorriso_set_change_pending(struct XorrisO *xorriso, int flag)
return(1); return(1);
} }
/* @param flag bit0= enable SCSI command logging to stderr */
int Xorriso_scsi_log(struct XorrisO *xorriso, int flag)
{
if(flag == 0)
burn_set_scsi_logging(0);
else
burn_set_scsi_logging(2|4);
return(1);
}

View File

@ -488,6 +488,10 @@ int Xorriso_pvd_info(struct XorrisO *xorriso, int flag);
/* @param flag bit0= do not set hln_change_pending */ /* @param flag bit0= do not set hln_change_pending */
int Xorriso_set_change_pending(struct XorrisO *xorriso, int flag); int Xorriso_set_change_pending(struct XorrisO *xorriso, int flag);
/* @param flag bit0= enable SCSI command logging to stderr */
int Xorriso_scsi_log(struct XorrisO *xorriso, int flag);
/* A pseudo file type for El-Torito bootsectors as in man 2 stat : /* A pseudo file type for El-Torito bootsectors as in man 2 stat :
For now take the highest possible value. For now take the highest possible value.