Improved MISHAP - SORRY mapping and tunneling

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

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);
}