+ if (!dev->has_cap(CAP_LABEL) && dcr->VolCatInfo.VolCatBytes == 0) {
+ Jmsg(dcr->jcr, M_WARNING, 0, _("Device %s not configured to autolabel Volumes.\n"),
+ dev->print_name());
+ }
+ /* If not removable, Volume is broken */
+ if (!dev->is_removable()) {
+ Jmsg(dcr->jcr, M_WARNING, 0, _("Volume \"%s\" not on device %s.\n"),
+ dcr->VolumeName, dev->print_name());
+ mark_volume_in_error(dcr);
+ return try_next_vol;
+ }
+ return try_default;
+}
+
+
+/*
+ * Mark volume in error in catalog
+ */
+void mark_volume_in_error(DCR *dcr)
+{
+ DEVICE *dev = dcr->dev;
+ Jmsg(dcr->jcr, M_INFO, 0, _("Marking Volume \"%s\" in Error in Catalog.\n"),
+ dcr->VolumeName);
+ dev->VolCatInfo = dcr->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(dcr, false);
+}
+
+/*
+ * The Volume is not in the correct slot, so mark this
+ * Volume as not being in the Changer.
+ */
+static void mark_volume_not_inchanger(DCR *dcr)
+{
+ JCR *jcr = dcr->jcr;
+ DEVICE *dev = dcr->dev;
+ Jmsg(jcr, M_ERROR, 0, _("Autochanger Volume \"%s\" not found in slot %d.\n"
+" Setting InChanger to zero in catalog.\n"),
+ dcr->VolCatInfo.VolCatName, dcr->VolCatInfo.Slot);
+ dev->VolCatInfo = dcr->VolCatInfo; /* structure assignment */
+ dcr->VolCatInfo.InChanger = false;
+ dev->VolCatInfo.InChanger = false;
+ Dmsg0(400, "update vol info in mount\n");
+ dir_update_volume_info(dcr, true); /* set new status */