+static void
+file_taper_result(
+ disk_t *dp)
+{
+ char *qname = quote_string(dp->name);
+
+ if (taper_result == DONE) {
+ update_info_taper(dp, taper_first_label, taper_first_fileno,
+ sched(dp)->level);
+ }
+
+ sched(dp)->taper_attempted += 1;
+
+ if (taper_input_error) {
+ g_printf("driver: taper failed %s %s: %s\n",
+ dp->host->hostname, qname, taper_input_error);
+ if (strcmp(sched(dp)->datestamp, driver_timestamp) == 0) {
+ if(sched(dp)->taper_attempted >= 2) {
+ log_add(L_FAIL, _("%s %s %s %d [too many taper retries after holding disk error: %s]"),
+ dp->host->hostname, qname, sched(dp)->datestamp,
+ sched(dp)->level, taper_input_error);
+ g_printf("driver: taper failed %s %s, too many taper retry after holding disk error\n",
+ dp->host->hostname, qname);
+ amfree(sched(dp)->destname);
+ amfree(sched(dp)->dumpdate);
+ amfree(sched(dp)->degr_dumpdate);
+ amfree(sched(dp)->degr_mesg);
+ amfree(sched(dp)->datestamp);
+ amfree(dp->up);
+ } else {
+ log_add(L_INFO, _("%s %s %s %d [Will retry dump because of holding disk error: %s]"),
+ dp->host->hostname, qname, sched(dp)->datestamp,
+ sched(dp)->level, taper_input_error);
+ g_printf("driver: taper will retry %s %s because of holding disk error\n",
+ dp->host->hostname, qname);
+ if (dp->to_holdingdisk != HOLD_REQUIRED) {
+ dp->to_holdingdisk = HOLD_NEVER;
+ sched(dp)->dump_attempted -= 1;
+ headqueue_disk(&directq, dp);
+ } else {
+ amfree(sched(dp)->destname);
+ amfree(sched(dp)->dumpdate);
+ amfree(sched(dp)->degr_dumpdate);
+ amfree(sched(dp)->degr_mesg);
+ amfree(sched(dp)->datestamp);
+ amfree(dp->up);
+ }
+ }
+ } else {
+ amfree(sched(dp)->destname);
+ amfree(sched(dp)->dumpdate);
+ amfree(sched(dp)->degr_dumpdate);
+ amfree(sched(dp)->degr_mesg);
+ amfree(sched(dp)->datestamp);
+ amfree(dp->up);
+ }
+ } else if (taper_tape_error) {
+ g_printf("driver: taper failed %s %s with tape error: %s\n",
+ dp->host->hostname, qname, taper_tape_error);
+ if(sched(dp)->taper_attempted >= 2) {
+ log_add(L_FAIL, _("%s %s %s %d [too many taper retries]"),
+ dp->host->hostname, qname, sched(dp)->datestamp,
+ sched(dp)->level);
+ g_printf("driver: taper failed %s %s, too many taper retry\n",
+ dp->host->hostname, qname);
+ amfree(sched(dp)->destname);
+ amfree(sched(dp)->dumpdate);
+ amfree(sched(dp)->degr_dumpdate);
+ amfree(sched(dp)->degr_mesg);
+ amfree(sched(dp)->datestamp);
+ amfree(dp->up);
+ } else {
+ g_printf("driver: taper will retry %s %s\n",
+ dp->host->hostname, qname);
+ /* Re-insert into taper queue. */
+ headqueue_disk(&tapeq, dp);
+ }
+ } else if (taper_result != DONE) {
+ g_printf("driver: taper failed %s %s without error\n",
+ dp->host->hostname, qname);
+ } else {
+ delete_diskspace(dp);
+ amfree(sched(dp)->destname);
+ amfree(sched(dp)->dumpdate);
+ amfree(sched(dp)->degr_dumpdate);
+ amfree(sched(dp)->degr_mesg);
+ amfree(sched(dp)->datestamp);
+ amfree(dp->up);
+ }
+
+ amfree(qname);
+
+ taper_busy = 0;
+ amfree(taper_input_error);
+ amfree(taper_tape_error);
+ taper_disk = NULL;
+
+ /* continue with those dumps waiting for diskspace */
+ continue_port_dumps();
+ start_some_dumps(&runq);
+ startaflush();
+}
+
+static void
+dumper_taper_result(
+ disk_t *dp)
+{
+ dumper_t *dumper;
+ int is_partial;
+ char *qname;
+
+ dumper = sched(dp)->dumper;
+
+ free_serial_dp(dp);
+ if(dumper->result == DONE && taper_result == DONE) {
+ update_info_dumper(dp, sched(dp)->origsize,
+ sched(dp)->dumpsize, sched(dp)->dumptime);
+ update_info_taper(dp, taper_first_label, taper_first_fileno,
+ sched(dp)->level);
+ qname = quote_string(dp->name); /*quote to take care of spaces*/
+
+ log_add(L_STATS, _("estimate %s %s %s %d [sec %ld nkb %lld ckb %lld kps %lu]"),
+ dp->host->hostname, qname, sched(dp)->datestamp,
+ sched(dp)->level,
+ sched(dp)->est_time, (long long)sched(dp)->est_nsize,
+ (long long)sched(dp)->est_csize,
+ sched(dp)->est_kps);
+ amfree(qname);
+ } else {
+ update_failed_dump(dp);
+ }
+
+ is_partial = dumper->result != DONE || taper_result != DONE;
+
+ sched(dp)->dump_attempted += 1;
+ sched(dp)->taper_attempted += 1;