if (slot > 0 && jcr->device->changer_name && jcr->device->changer_command) {
uint32_t timeout = jcr->device->max_changer_wait;
if (slot > 0 && jcr->device->changer_name && jcr->device->changer_command) {
uint32_t timeout = jcr->device->max_changer_wait;
- Jmsg(jcr, M_INFO, 0, _("3991 Bad autochanger \"load slot\" status=%d.\n"), status);
+ Jmsg(jcr, M_INFO, 0, _("3991 Bad autochanger \"loaded\" command, status=%d.\n"), status);
/* If bad status or tape we want is not loaded, load it. */
if (status != 0 || loaded != slot) {
/* If bad status or tape we want is not loaded, load it. */
if (status != 0 || loaded != slot) {
/* We are going to load a new tape, so close the device */
force_close_dev(dev);
if (loaded != 0) { /* must unload drive */
/* We are going to load a new tape, so close the device */
force_close_dev(dev);
if (loaded != 0) { /* must unload drive */
Jmsg(jcr, M_INFO, 0, _("3302 Issuing autochanger \"unload\" command.\n"));
changer = edit_device_codes(jcr, changer,
jcr->device->changer_command, "unload");
status = run_program(changer, timeout, NULL);
Jmsg(jcr, M_INFO, 0, _("3302 Issuing autochanger \"unload\" command.\n"));
changer = edit_device_codes(jcr, changer,
jcr->device->changer_command, "unload");
status = run_program(changer, timeout, NULL);
Jmsg(jcr, M_INFO, 0, _("3303 Issuing autochanger \"load slot %d\" command.\n"),
slot);
changer = edit_device_codes(jcr, changer,
jcr->device->changer_command, "load");
status = run_program(changer, timeout, NULL);
if (status == 0) {
Jmsg(jcr, M_INFO, 0, _("3303 Issuing autochanger \"load slot %d\" command.\n"),
slot);
changer = edit_device_codes(jcr, changer,
jcr->device->changer_command, "load");
status = run_program(changer, timeout, NULL);
if (status == 0) {
- Jmsg(jcr, M_INFO, 0, _("3304 Autochanger \"load slot %d\" status is OK.\n"),
+ Jmsg(jcr, M_INFO, 0, _("3304 Autochanger \"load slot %d\", status is OK.\n"),
- Jmsg(jcr, M_INFO, 0, _("3992 Bad autochanger \"load slot\" status=%d.\n"),
- status);
+ Jmsg(jcr, M_INFO, 0, _("3992 Bad autochanger \"load slot %d\", status=%d.\n"),
+ slot, status);
- Dmsg2(100, "load slot %d status=%d\n", slot, status);
+ Dmsg2(400, "load slot %d status=%d\n", slot, status);
- Dmsg1(100, "After changer, status=%d\n", status);
+ Dmsg1(400, "After changer, status=%d\n", status);
-void invalidate_slot_in_catalog(JCR *jcr)
+/*
+ * The Volume is not in the correct slot, so mark this
+ * Volume as not being in the Changer.
+ */
+void invalid_slot_in_catalog(JCR *jcr, DEVICE *dev)
{
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);
{
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 */
+ jcr->VolCatInfo.InChanger = false;
+ dev->VolCatInfo.InChanger = false;
+ Dmsg0(100, "update vol info in mount\n");
+ dir_update_volume_info(jcr, dev, 1); /* set new status */