return false;
}
memset(&vol, 0, sizeof(vol));
- Dmsg1(100, "<dird %s", dir->msg);
+ Dmsg1(100, "<dird %s\n", 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, &vol.VolMediaId);
if (n != 22) {
- Dmsg2(100, "Bad response from Dir fields=%d: %s", n, dir->msg);
+ Dmsg3(100, "Bad response from Dir fields=%d, len=%d: %s", n, dir->msglen, dir->msg);
Mmsg(jcr->errmsg, _("Error getting Volume info: %s"), dir->msg);
return false;
}
bash_spaces(dcr->VolCatInfo.VolCatName);
dir->fsend(Get_Vol_Info, jcr->Job, dcr->VolCatInfo.VolCatName,
writing==GET_VOL_INFO_FOR_WRITE?1:0);
- Dmsg1(100, ">dird: %s", dir->msg);
+ Dmsg1(100, ">dird: %s\n", dir->msg);
unbash_spaces(dcr->VolCatInfo.VolCatName);
bool ok = do_get_volume_info(dcr);
V(vol_info_mutex);
*/
static bool is_vol_in_autochanger(RCTX &rctx, VOLRES *vol)
{
- AUTOCHANGER *changer;
-
- return false;
+ AUTOCHANGER *changer = vol->dev->device->changer_res;
- Dmsg2(dbglvl, "jid=%u search changers for %s\n", (int)rctx.jcr->JobId,
- rctx.device_name);
- foreach_res(changer, R_AUTOCHANGER) {
- Dmsg3(dbglvl, "jid=%u Try match changer res=%s device=%s\n",
- (int)rctx.jcr->JobId, changer->hdr.name, rctx.device_name);
- /* Find resource, and make sure we were able to open it */
- if (fnmatch(rctx.device_name, changer->hdr.name, 0) == 0) {
- DEVRES *device;
- /* Try each device in this AutoChanger */
- foreach_alist(device, changer->device) {
- if (device->dev == vol->dev) {
- Dmsg2(dbglvl, "jid=%u Found changer device %s\n",
- (int)rctx.jcr->JobId, device->hdr.name);
- return true;
- }
- Dmsg2(dbglvl, "jid=%u Incorrect changer device %s\n",
- (int)rctx.jcr->JobId, device->hdr.name);
- }
- }
- }
+ /* Find resource, and make sure we were able to open it */
+ if (fnmatch(rctx.device_name, changer->hdr.name, 0) == 0) {
+ Dmsg2(dbglvl, "jid=%u Found changer device %s\n",
+ (int)rctx.jcr->JobId, vol->dev->device->hdr.name);
+ return true;
+ }
+ Dmsg2(dbglvl, "jid=%u Incorrect changer device %s\n",
+ (int)rctx.jcr->JobId, changer->hdr.name);
return false;
}
continue;
}
- Dmsg2(dbglvl, "jid=%u vol=%s\n", (int)rctx.jcr->JobId, vol->vol_name);
+ Dmsg2(dbglvl, "jid=%u vol=%s OK for this job\n", (int)rctx.jcr->JobId, vol->vol_name);
foreach_alist(store, dirstore) {
int stat;
rctx.store = store;
break;
}
}
+ if (ok) {
+ break;
+ }
} /* end for loop over reserved volumes */
lock_volumes();
unlock_volumes();
}
if (ok) {
- Dmsg2(dbglvl, "jid=%u got vol %s in reserved volums list\n", (int)rctx.jcr->JobId,
+ Dmsg2(dbglvl, "jid=%u got vol %s from in-use vols list\n", (int)rctx.jcr->JobId,
rctx.VolumeName);
return true;
}