* Load the desired cassette
*/
lock_changer(dcr);
- Dmsg1(100, "Doing changer load slot %d\n", slot);
+ Dmsg2(100, "Doing changer load slot %d %s\n", slot, dev->print_name());
Jmsg(jcr, M_INFO, 0,
_("3304 Issuing autochanger \"load slot %d, drive %d\" command.\n"),
slot, drive);
/* Virtual disk autochanger */
if (dcr->device->changer_command[0] == 0) {
+ dev->clear_unload();
return true;
}
} else {
dev->Slot = 0; /* nothing loaded */
}
- dev->clear_unload();
unlock_changer(dcr);
free_volume(dev); /* Free any volume associated with this drive */
free_pool_memory(changer);
}
+ dev->clear_unload();
return ok;
}
ok = false;
dev->Slot = -1; /* unknown */
} else {
+ Dmsg2(100, "Slot %d unloaded %s\n", dev->Slot, dev->print_name());
dev->Slot = 0; /* nothing loaded */
- Dmsg0(100, "Slot unloaded\n");
}
dev->clear_unload();
unlock_changer(dcr);
send_dir_busy_message(dir, dev);
} else { /* device not being used */
Dmsg0(90, "Device not in use, releasing\n");
- unload_autochanger(dcr, -1);
dcr->release_volume();
dir->fsend(_("3022 Device %s released.\n"),
dev->print_name());
{
if (dev->must_unload()) {
Dmsg1(100, "swapping: unloading %s\n", dev->print_name());
- unload_autochanger(this, -1);
release_volume();
dev->clear_unload();
}
*/
void DCR::release_volume()
{
+ unload_autochanger(this, -1);
+
if (WroteVol) {
Jmsg0(jcr, M_ERROR, 0, _("Hey!!!!! WroteVol non-zero !!!!!\n"));
Dmsg0(190, "Hey!!!!! WroteVol non-zero !!!!!\n");
Dmsg1(dbglvl, "%s", msg.c_str());
}
-#ifdef xxx
- DEVICE *dev = NULL;
- foreach_dlist(vol, vol_list) {
- if (vol->dev == dev) {
- Dmsg0(dbglvl, "Two Volumes on same device.\n");
- ASSERT(0);
- dev = vol->dev;
- }
- }
-#endif
-
unlock_volumes();
}
}
Dmsg2(dbglvl, "reserve_vol free vol=%s at %p\n", vol->vol_name, vol->vol_name);
free_volume(dev);
+// volume_unused(dcr);
dev->set_unload(); /* have to unload current volume */
debug_list_volumes("reserve_vol free");
}
Dmsg3(dbglvl, "==== Swap vol=%s from dev=%s to %s\n",
VolumeName, vol->dev->print_name(), dev->print_name());
free_volume(dev); /* free any volume attached to our drive */
+// volume_unused(dcr);
+ dev->set_unload(); /* Unload any volume that is on our drive */
dcr->dev = vol->dev; /* temp point to other dev */
- slot = get_autochanger_loaded_slot(dcr); /* get slot */
+ slot = get_autochanger_loaded_slot(dcr); /* get slot on other drive */
dcr->dev = dev; /* restore dev */
vol->set_slot(slot); /* save slot */
vol->dev->set_unload(); /* unload the other drive */
if (!vol->is_swapping()) {
dev->vol = NULL;
vol_list->remove(vol);
- Dmsg2(dbglvl, "=== free_volume %s dev=%s\n", vol->vol_name, dev->print_name());
+ Dmsg2(dbglvl, "=== remove volume %s dev=%s\n", vol->vol_name, dev->print_name());
free_vol_item(vol);
debug_list_volumes("free_volume");
}
*/
#undef VERSION
-#define VERSION "2.3.21"
-#define BDATE "21 May 2008"
-#define LSMDATE "21May08"
+#define VERSION "2.3.22"
+#define BDATE "24 May 2008"
+#define LSMDATE "24May08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
General:
+24May08
+kes Enhance a couple of SD debug messages.
+kes Tweak unload flag setting and ensure it is set during swap.
23May08
ebl Fix #1091 about bad output in estimate command.
21May08