autochanger = false;
VolCatInfo.Slot = 0;
}
- Dmsg1(200, "autoload_dev returns %d\n", autochanger);
+ Dmsg1(150, "autoload_dev returns %d\n", autochanger);
/*
* If we autochanged to correct Volume or (we have not just
* released the Volume AND we can automount) we go ahead
void DCR::do_swapping()
{
if (dev->must_unload()) {
- Dmsg0(150, "mount_next_volume release=1\n");
+ Dmsg1(100, "swapping: unloading %s\n", dev->print_name());
unload_autochanger(this, -1);
release_volume();
dev->clear_unload();
* volume to our drive.
*/
if (dev->swap_dev) {
- Dmsg1(100, "Swap unloading %s\n", dev->swap_dev->print_name());
if (dev->swap_dev->must_unload()) {
+ if (dev->vol) {
+ dev->Slot = dev->vol->get_slot();
+ }
+ Dmsg2(100, "Swap unloading slot=%d %s\n", dev->Slot,
+ dev->swap_dev->print_name());
unload_dev(this, dev->swap_dev);
+ dev->Slot = -1;
}
if (dev->vol) {
dev->vol->clear_swapping();
dev->swap_dev = NULL;
}
if (dev->must_load()) {
+ Dmsg1(100, "swapping: must load %s\n", dev->print_name());
dev->clear_load();
dev->clear_volhdr(); /* force "load" */
}
{
Jmsg(jcr, M_INFO, 0, _("Marking Volume \"%s\" in Error in Catalog.\n"),
VolumeName);
- dev->VolCatInfo = VolCatInfo; /* structure assignment */
+ dev->VolCatInfo = VolCatInfo; /* structure assignment */
bstrncpy(dev->VolCatInfo.VolCatStatus, "Error", sizeof(dev->VolCatInfo.VolCatStatus));
Dmsg0(150, "dir_update_vol_info. Set Error.\n");
dir_update_volume_info(this, false, false);
volume_unused(this);
+ dev->set_unload(); /* must get a new volume */
}
/*
if (dev->is_open()) {
dev->offline_or_rewind();
}
+ dev->set_unload();
Dmsg0(190, "release_volume\n");
}