if ((errstat=rwl_init(&reservation_lock)) != 0) {
berrno be;
Emsg1(M_ABORT, 0, _("Unable to initialize reservation lock. ERR=%s\n"),
- be.strerror(errstat));
+ be.bstrerror(errstat));
}
}
if ((errstat=rwl_writelock(&reservation_lock)) != 0) {
berrno be;
Emsg2(M_ABORT, 0, "rwl_writelock failure. stat=%d: ERR=%s\n",
- errstat, be.strerror(errstat));
+ errstat, be.bstrerror(errstat));
}
}
if ((errstat=rwl_writeunlock(&reservation_lock)) != 0) {
berrno be;
Emsg2(M_ABORT, 0, "rwl_writeunlock failure. stat=%d: ERR=%s\n",
- errstat, be.strerror(errstat));
+ errstat, be.bstrerror(errstat));
}
}
* Wiffle through them and find one that can do the backup.
*/
if (ok) {
- bool first = true; /* print wait message once */
+ int retries = 0; /* wait for device retries */
bool fail = false;
rctx.notify_dir = true;
lock_reservations();
}
/* Keep reservations locked *except* during wait_for_device() */
unlock_reservations();
- if (!rctx.suitable_device || !wait_for_device(jcr, first)) {
+ if (!rctx.suitable_device || !wait_for_device(jcr, retries)) {
Dmsg0(100, "Fail. !suitable_device || !wait_for_device\n");
fail = true;
}
lock_reservations();
- first = false;
bnet_sig(dir, BNET_HEARTBEAT); /* Inform Dir that we are alive */
}
unlock_reservations();
}
/* Check for prefer mounted volumes */
- if (rctx.PreferMountedVols && !dev->VolHdr.VolumeName[0] && dev->is_tape()) {
+// if (rctx.PreferMountedVols && !dev->VolHdr.VolumeName[0] && dev->is_tape()) {
+ if (rctx.PreferMountedVols && !dev->vol && dev->is_tape()) {
Mmsg(jcr->errmsg, _("3606 JobId=%u prefers mounted drives, but drive %s has no Volume.\n"),
jcr->JobId, dev->print_name());
queue_reserve_message(jcr);
- Dmsg1(110, "failed: want mounted -- no vol JobId=%u\n", jcr->JobId);
+ Dmsg1(110, "failed: want mounted -- no vol JobId=%u\n", (uint32_t)jcr->JobId);
return 0; /* No volume mounted */
}
/* Check for exact Volume name match */
+ /* ***FIXME*** use dev->vol.VolumeName */
if (rctx.exact_match && rctx.have_volume &&
strcmp(dev->VolHdr.VolumeName, rctx.VolumeName) != 0) {
Mmsg(jcr->errmsg, _("3607 JobId=%u wants Vol=\"%s\" drive has Vol=\"%s\" on drive %s.\n"),
}
/* Check for unused autochanger drive */
+ /* ***FIXME*** use !dev->is_busy() */
if (rctx.autochanger_only && dev->num_writers == 0 &&
dev->VolHdr.VolumeName[0] == 0) {
/* Device is available but not yet reserved, reserve it for us */