bool ok = do_get_volume_info(dcr);
if (ok) {
if (!is_volume_in_use(dcr)) {
- Dmsg1(100, "Attempt reserve. Vol=%s\n", dcr->VolumeName);
+ Dmsg1(100, "Call reserve_volume. Vol=%s\n", dcr->VolumeName);
if (reserve_volume(dcr, dcr->VolumeName) == 0) {
Dmsg2(100, "Could not reserve volume %s on %s\n", dcr->VolumeName,
dcr->dev->print_name());
}
dev->set_labeled(); /* set has Bacula label */
+ Dmsg0(100, "Call reserve_volume\n");
if (reserve_volume(dcr, dev->VolHdr.VolumeName) == NULL) {
Mmsg2(jcr->errmsg, _("Could not reserve volume %s on %s\n"),
dev->VolHdr.VolumeName, dev->print_name());
if (debug_level >= 20) {
dump_volume_label(dev);
}
+ Dmsg0(100, "Call reserve_volume\n");
if (reserve_volume(dcr, VolName) == NULL) {
Mmsg2(dcr->jcr->errmsg, _("Could not reserve volume %s on %s\n"),
dev->VolHdr.VolumeName, dev->print_name());
* explicitly read in this drive. This allows the SD to remember
* where the tapes are or last were.
*/
- Dmsg3(dbglvl, "=== mark released vol=%s num_writers=%d reserved=%d\n",
+ Dmsg3(dbglvl, "=== mark released vol=%s num_writers=%d dev_reserved=%d\n",
dev->vol->vol_name, dev->num_writers, dev->reserved_device);
dev->vol->released = true;
if (dev->is_tape()) { // || dev->is_autochanger()) {
free_vol_item(vol);
debug_list_volumes("free_volume");
unlock_volumes();
- return vol != NULL;
+// return vol != NULL;
+ return true;
}
/*
* Search for a device suitable for this job.
+ * Note, this routine sets sets rctx.suitable_device if any
+ * device exists within the SD. The device may not be actually
+ * useable.
+ * It also returns if it finds a useable device.
*/
bool find_suitable_device_for_job(JCR *jcr, RCTX &rctx)
{
debug_list_volumes("=== After free temp table\n");
}
if (ok) {
- Dmsg1(dbglvl, "got vol %s from in-use vols list\n", rctx.VolumeName);
+ Dmsg1(dbglvl, "Usable dev found. Vol=%s from in-use vols list\n", rctx.VolumeName);
return true;
}
ok = true;
break;
} else if (stat == 0) { /* device busy */
- Dmsg1(dbglvl, "Suitable device=%s, busy: not use\n", device_name);
+ Dmsg1(dbglvl, "No usable device=%s, busy: not use\n", device_name);
} else {
/* otherwise error */
- Dmsg0(dbglvl, "No suitable device found.\n");
+ Dmsg0(dbglvl, "No usable device found.\n");
}
}
if (ok) {
break;
}
}
+ if (ok) {
+ Dmsg1(dbglvl, "Usable dev found. Vol=%s\n", rctx.VolumeName);
+ }
return ok;
}
Dmsg3(dbglvl, "Vol=%s num_writers=%d, have_vol=%d\n",
rctx.VolumeName, dcr->dev->num_writers, rctx.have_volume);
if (rctx.have_volume) {
+ Dmsg0(dbglvl, "Call reserve_volume\n");
if (reserve_volume(dcr, rctx.VolumeName)) {
Dmsg1(dbglvl, "Reserved vol=%s\n", rctx.VolumeName);
} else {