/* If bad status or tape we want is not loaded, load it. */
if (status != 0 || loaded != slot) {
- if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) {
- offline_dev(dev);
- }
+ offline_or_rewind_dev(dev);
/* We are going to load a new tape, so close the device */
force_close_dev(dev);
if (loaded != 0) { /* must unload drive */
return rtn_stat;
}
+void invalidate_slot_in_catalog(JCR *jcr)
+{
+ Jmsg(jcr, M_ERROR, 0, _("Autochanger Volume \"%s\" not found in slot %d.\n"
+" Setting slot to zero in catalog.\n"),
+ jcr->VolCatInfo.VolCatName, jcr->VolCatInfo.Slot);
+ jcr->VolCatInfo.Slot = 0; /* invalidate slot */
+ Dmsg0(200, "update vol info in mount\n");
+ dir_update_volume_info(jcr, &jcr->VolCatInfo, 1); /* set slot */
+}
+
/*
* List the Volumes that are in the autoloader possibly
* with their barcodes.
}
changer = get_pool_memory(PM_FNAME);
- if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) {
- offline_dev(dev);
- }
+ offline_or_rewind_dev(dev);
/* We are going to load a new tape, so close the device */
force_close_dev(dev);
str = "%";
break;
case 'a':
- str = jcr->device->dev->dev_name;
+ str = dev_name(jcr->device->dev);
break;
case 'c':
str = NPRT(jcr->device->changer_name);