Improved MISHAP - SORRY mapping and tunneling

This commit is contained in:
Thomas Schmitt 2008-02-12 21:54:17 +00:00
parent a1c8a7438a
commit 4c2be49aa0
4 changed files with 73 additions and 7 deletions

View File

@ -775,9 +775,21 @@ int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno,
iso_sev= iso_error_get_severity(iso_error_code);
sev_text_pt= min_severity;
burn_text_to_sev(min_severity, &min_sev, 0);
if(min_sev < iso_sev)
/* <<< Tunnel MISHAP through libburn which knows no MISHAP
with libburn-0.4.4 this is not necessary */
if(iso_sev==LIBDAX_MSGS_SEV_MISHAP) {
iso_sev= LIBDAX_MSGS_SEV_SORRY;
error_code= 0x0005ff73;
}
if(min_sev < iso_sev) {
/* >>> with libburn-0.4.4 do: burn_sev_to_text(iso_sev, &sev_text_pt, 0); */
isoburn__sev_to_text(iso_sev, &sev_text_pt, 0);
}
ret= burn_msgs_submit(error_code, msg_text_pt, os_errno, sev_text_pt, NULL);
return(ret);
}

View File

@ -4803,7 +4803,7 @@ int Xorriso_eval_problem_status(struct XorrisO *xorriso, int ret, int flag)
ret= 2;
} else if(xorriso->problem_status > 0) {
sprintf(xorriso->info_text,
"xorriso : ABORT : -abort_on '%s' encountered '%s'",
"xorriso : aborting : -abort_on '%s' encountered '%s'",
xorriso->abort_on_text, xorriso->problem_status_text);
if(!(flag&1))
Xorriso_info(xorriso, 0);/* submit not as problem event */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.02.11.213918"
#define Xorriso_timestamP "2008.02.12.215327"

View File

@ -955,13 +955,43 @@ ex:;
}
int Xorriso_check_burn_abort(struct XorrisO *xorriso, int flag)
{
int ret;
struct burn_drive_info *dinfo;
struct burn_drive *drive;
if(xorriso->run_state!=1)
return(0);
ret= Xorriso_eval_problem_status(xorriso, 1, 1);
if(ret>=0)
return(0);
sprintf(xorriso->info_text,
"-abort_on '%s' encountered '%s' during image writing",
xorriso->abort_on_text, xorriso->problem_status_text);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0,
xorriso->problem_status_text, 0);
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to abort burn run", 2);
if(ret<=0)
return(0);
burn_drive_cancel(drive);
sprintf(xorriso->info_text,
"libburn has now been urged to cancel its operation");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
return(1);
}
/* This loop watches burn runs until they end.
It issues pacifying update messages to the user.
*/
int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
int flag)
{
int ret, size, free_bytes, i;
int ret, size, free_bytes, i, aborting= 0;
struct burn_progress progress;
char *status_text;
enum burn_drive_status drive_status;
@ -1000,6 +1030,8 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive,
for(i= 0; i<10; i++) {
Xorriso_process_msg_queues(xorriso, 0);
if(aborting<=0)
aborting= Xorriso_check_burn_abort(xorriso, 0);
usleep(100000);
}
}
@ -1694,14 +1726,30 @@ int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
if((error_code>=0x00030000 && error_code<0x00040000) ||
(error_code>=0x00050000 && error_code<0x00060000))
tunneled= -1; /* "libisofs:" */
if(error_code>=0x00060000 && error_code<0x00070000)
else if(error_code>=0x00060000 && error_code<0x00070000)
tunneled= 1; /* "libisoburn:" */
}
if(ret<=0)
break;
/* <<< tunneled MISHAP from libisoburn through libburn
or well known error codes of MISHAP events
With libburn-0.4.4 this is not necessary */
if(error_code==0x5ff73 || error_code==0x3ff73 ||
error_code==0x3feb9 || error_code==0x3feb2)
strcpy(severity, "MISHAP");
#ifdef NIX
/* ??? throw this out already yet and rely on above libburn workaround ?*/
/* <<< SORRY messages during burn run get mapped to MISHAP
should not be necessary with libisofs-0.6.4 */
if(pass+tunneled==0 && xorriso->run_state==1 &&
strcmp(severity, "SORRY")==0)
strcmp(severity, "SORRY")==0) {
fprintf(stderr, "xorriso_DEBUG: %s %X\n", severity, error_code);
strcpy(severity, "MISHAP"); /* image generation severity */
}
#endif
Xorriso_msgs_submit(xorriso, error_code, xorriso->info_text, os_errno,
severity, ((pass+tunneled)+1)<<2);
count++;
@ -3624,9 +3672,15 @@ int Xorriso_set_abort_severity(struct XorrisO *xorriso, int flag)
{
int ret;
/* <<< On MISHAP use FAILURE as abort severity known to libisofs.
The pacifier loop will care for canceling libburn on MISHAP
and thus also cancel the image generation.
with libisofs-0.6.4 this should not be necessary
*/
if((flag&1) && strcmp(xorriso->abort_on_text, "MISHAP")==0)
ret= iso_set_abort_severity("SORRY");
ret= iso_set_abort_severity("FAILURE");
else
ret= iso_set_abort_severity(xorriso->abort_on_text);
return(ret>=0);
}