return false;
}
memset(&vol, 0, sizeof(vol));
- Dmsg1(100, "<dird %s", dir->msg);
+ Dmsg1(110, "<dird %s", dir->msg);
n = sscanf(dir->msg, OK_media, vol.VolCatName,
&vol.VolCatJobs, &vol.VolCatFiles,
&vol.VolCatBlocks, &vol.VolCatBytes,
&vol.EndFile, &vol.EndBlock, &vol.VolCatParts,
&vol.LabelType);
if (n != 21) {
- Dmsg2(100, "Bad response from Dir fields=%d: %s", n, dir->msg);
+ Dmsg2(110, "Bad response from Dir fields=%d: %s", n, dir->msg);
Mmsg(jcr->errmsg, _("Error getting Volume info: %s"), dir->msg);
return false;
}
return ok;
}
+
+
/*
* Get info on the next appendable volume in the Director's database
* Returns: true on success
* the most available could already be mounted on another
* drive, so we continue looking for a not in use Volume.
*/
+ lock_reservations();
for (int vol_index=1; vol_index < 20; vol_index++) {
bash_spaces(dcr->media_type);
bash_spaces(dcr->pool_name);
continue;
}
} else {
- Dmsg0(200, "No volume info, return false\n");
- return false;
+ Dmsg2(100, "No vol. index %d return false. dev=%s\n", vol_index,
+ dcr->dev->print_name());
+ found = false;
+ break;
}
}
if (found) {
Dmsg0(400, "dir_find_next_appendable_volume return true\n");
new_volume(dcr, dcr->VolumeName); /* reserve volume */
+ unlock_reservations();
return true;
}
dcr->VolumeName[0] = 0;
+ unlock_reservations();
return false;
}
/* Do not lock device here because it may be locked from label */
if (!do_get_volume_info(dcr)) {
Jmsg(jcr, M_FATAL, 0, "%s", jcr->errmsg);
- Pmsg2(000, _("Didn't get vol info vol=%s: ERR=%s"),
+ Dmsg2(100, _("Didn't get vol info vol=%s: ERR=%s"),
vol->VolCatName, jcr->errmsg);
return false;
}
}
}
- jcr->JobStatus = JS_WaitMedia;
+ set_jcr_job_status(jcr, JS_WaitMedia);
dir_send_job_status(jcr);
stat = wait_for_sysop(dcr);
dcr->VolumeName, dev->print_name(), jcr->Job);
}
- jcr->JobStatus = JS_WaitMount;
+ set_jcr_job_status(jcr, JS_WaitMount);
dir_send_job_status(jcr);
stat = wait_for_sysop(dcr); /* wait on device */