recycle = ask = autochanger = 0;
if (release) {
Dmsg0(100, "mount_next_volume release=1\n");
-
release_volume(jcr, dev);
ask = 1; /* ask operator to mount tape */
}
dev->state &= ~(ST_APPEND|ST_READ|ST_EOT|ST_WEOT|ST_EOF);
- jcr->VolFirstIndex = jcr->JobFiles; /* first update of Vol FileIndex */
for ( ;; ) {
int vol_label_status;
autochanger = autoload_device(jcr, dev, 1, NULL);
memcpy(&VolCatInfo, &jcr->VolCatInfo, sizeof(jcr->VolCatInfo));
/* Check if this is a valid Volume in the pool */
pm_strcpy(&jcr->VolumeName, dev->VolHdr.VolName);
- if (!dir_get_volume_info(jcr, 1)) {
+ if (!dir_get_volume_info(jcr, GET_VOL_INFO_FOR_WRITE)) {
Mmsg(&jcr->errmsg, _("Director wanted Volume \"%s\".\n"
" Current Volume \"%s\" not acceptable because:\n"
" %s"),
return 0;
}
+/*
+ * Either because we are going to hang a new volume, or because
+ * of explicit user request, we release the current volume.
+ */
void release_volume(JCR *jcr, DEVICE *dev)
{
+
+ if (jcr->WroteVol) {
+ Jmsg0(jcr, M_ERROR, 0, "Hey!!!!! WroteVol non-zero !!!!!\n");
+ }
/*
* First erase all memory of the current volume
*/