Mmsg(&mdb->cmd, "UPDATE Media SET VolJobs=%d,\
VolFiles=%d, VolBlocks=%d, VolBytes=%s, VolMounts=%d, VolErrors=%d,\
- VolWrites=%d, VolMaxBytes=%s, LastWritten=\"%s\", VolStatus=\"%s\" \
- WHERE VolumeName=\"%s\"",
+ VolWrites=%d, VolMaxBytes=%s, LastWritten=\"%s\", VolStatus=\"%s\",\
+ Slot=%d WHERE VolumeName=\"%s\"",
mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1),
mr->VolMounts, mr->VolErrors, mr->VolWrites,
edit_uint64(mr->VolMaxBytes, ed2), dt,
- mr->VolStatus, mr->VolumeName);
+ mr->VolStatus, mr->Slot, mr->VolumeName);
stat = UPDATE_DB(mdb, mdb->cmd);
db_unlock(mdb);
static char Update_media[] = "CatReq Job=%127s UpdateMedia VolName=%s\
VolJobs=%d VolFiles=%d VolBlocks=%d VolBytes=%" lld " VolMounts=%d\
VolErrors=%d VolWrites=%d VolMaxBytes=%" lld " EndTime=%d VolStatus=%10s\
- FirstIndex=%d LastIndex=%d StartFile=%d EndFile=%d \
- StartBlock=%d EndBlock=%d relabel=%d Slot=%d\n";
+ Slot=%d relabel=%d\n";
static char Create_job_media[] = "CatReq Job=%127s CreateJobMedia \
FirstIndex=%d LastIndex=%d StartFile=%d EndFile=%d \
} else if (sscanf(bs->msg, Update_media, &Job, &mr.VolumeName, &mr.VolJobs,
&mr.VolFiles, &mr.VolBlocks, &mr.VolBytes, &mr.VolMounts, &mr.VolErrors,
&mr.VolWrites, &mr.VolMaxBytes, &mr.LastWritten, &mr.VolStatus,
- &jm.FirstIndex, &jm.LastIndex, &jm.StartFile, &jm.EndFile,
- &jm.StartBlock, &jm.EndBlock, &relabel, &mr.Slot) == 20) {
+ &mr.Slot, &relabel) == 14) {
/*
* Update Media Record
*/
int chldstatus = 0;
pid_t pid1, pid2;
int pfd[2];
- int i;
build_argc_argv(prog);
-#ifdef lots_of_debug
+#ifdef xxxxxxxxxxx
printf("argc=%d\n", bargc);
+ int i;
for (i=0; i<bargc; i++) {
printf("argc=%d argv=%s\n", i, bargv[i]);
}
static char Update_media[] = "CatReq Job=%s UpdateMedia VolName=%s\
VolJobs=%d VolFiles=%d VolBlocks=%d VolBytes=%" lld " VolMounts=%d\
VolErrors=%d VolWrites=%d VolMaxBytes=%" lld " EndTime=%d VolStatus=%s\
- FirstIndex=%d LastIndex=%d StartFile=%d EndFile=%d \
- StartBlock=%d EndBlock=%d relabel=%d Slot=%d\n";
+ Slot=%d relabel=%d\n";
static char Create_job_media[] = "CatReq Job=%s CreateJobMedia \
FirstIndex=%d LastIndex=%d StartFile=%d EndFile=%d \
vol->VolCatBlocks, vol->VolCatBytes,
vol->VolCatMounts, vol->VolCatErrors,
vol->VolCatWrites, vol->VolCatMaxBytes, EndTime,
- vol->VolCatStatus,
- jcr->VolFirstFile, jcr->JobFiles,
- jcr->start_file, jcr->end_file,
- jcr->start_block, jcr->end_block,
- relabel, vol->Slot);
+ vol->VolCatStatus, vol->Slot, relabel);
Dmsg1(20, "update_volume_data(): %s", dir->msg);
if (bnet_recv(dir) <= 0) {
Dmsg0(90, "updateVolCatInfo error bnet_recv\n");
*/
static int mount_next_volume(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, int release)
{
- int recycle, ask, retry = 0;
+ int recycle, ask, retry = 0, autochanger;
Dmsg0(90, "Enter mount_next_volume()\n");
mount_next_vol:
if (retry++ > 5) {
- Mmsg0(&dev->errmsg, _("Too many retries.\n"));
+ Jmsg(jcr, M_FATAL, 0, _("Too many errors on device %s.\n"), dev_name(dev));
return 0;
}
if (job_cancelled(jcr)) {
- Mmsg0(&dev->errmsg, _("Job cancelled.\n"));
+ Jmsg(jcr, M_FATAL, 0, _("Job cancelled.\n"));
return 0;
}
- recycle = 0;
- ask = 0;
+ recycle = ask = autochanger = 0;
if (release) {
Dmsg0(500, "mount_next_volume release=1\n");
/*
Dmsg1(100, "After changer, status=%d\n", status);
if (status == 0) { /* did we succeed? */
ask = 0; /* yes, got vol, no need to ask sysop */
+ autochanger = 1; /* tape loaded by changer */
}
}
default:
/* Send error message */
Jmsg(jcr, M_WARNING, 0, "%s", jcr->errmsg);
+ if (autochanger) {
+ Jmsg(jcr, M_ERROR, 0, _("Autochanger Volume %s not found in slot %d.\n\
+ Setting slot to zero in catalog.\n"),
+ jcr->VolumeName, jcr->VolCatInfo.Slot);
+ jcr->VolCatInfo.Slot = 0; /* invalidate slot */
+ dir_update_volume_info(jcr, &jcr->VolCatInfo, 1); /* set slot */
+ }
goto mount_next_vol;
}
break;