]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Fix logic error in handling error return from mtx-changer
authorKern Sibbald <kern@sibbald.com>
Fri, 8 Sep 2006 21:10:22 +0000 (21:10 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 8 Sep 2006 21:10:22 +0000 (21:10 +0000)
     script.
kes  Make status from SD aware of -1 (unknown) Slot status.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3442 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/autochanger.c
bacula/src/stored/status.c
bacula/technotes-1.39

index 65549cfe70e2ffe17537996e4f334c8cc2c1b467..5de6cb60b06fb4b69a3609196cb2dc3472ce9ea9 100644 (file)
@@ -332,8 +332,9 @@ bool unload_autochanger(DCR *dcr, int loaded)
          Jmsg(jcr, M_INFO, 0, _("3995 Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n"),
                  slot, dev->drive_index, be.strerror());
          ok = false;
+         dev->Slot = -1;           /* unknown */
       } else {
-         dev->Slot = -1;           /* unknown */ 
+         dev->Slot = 0;            /* nothing loaded */
       }
       free_pool_memory(changer);
       unlock_changer(dcr);
@@ -431,8 +432,9 @@ static bool unload_other_drive(DCR *dcr, int slot)
       Dmsg3(100, "Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n",
               slot, dev->drive_index, be.strerror());
       ok = false;
+      dev->Slot = -1;          /* unknown */
    } else {
-      dev->Slot = -1;           /* nothing loaded */
+      dev->Slot = 0;           /* nothing loaded */
       Dmsg0(100, "Slot unloaded\n");
    }
    unlock_changer(dcr);
index b21d277911d1ddc8ebd1a47bd092e45b80832af4..db3a2c4c5eb250a932551a6342f7c8a6164a7b8c 100644 (file)
@@ -256,13 +256,16 @@ static void send_blocked_status(DEVICE *dev, void sendit(const char *msg, int le
    }
    /* Send autochanger slot status */
    if (dev->is_autochanger()) {
-      if (dev->Slot) {
+      if (dev->Slot > 0) {
          len = Mmsg(msg, _("    Slot %d is loaded in drive %d.\n"), 
             dev->Slot, dev->drive_index);
          sendit(msg, len, arg);
-      } else {
+      } else if (dev->Slot == 0) {
          len = Mmsg(msg, _("    Drive %d is not loaded.\n"), dev->drive_index);
          sendit(msg, len, arg);
+      } else {
+         len = Mmsg(msg, _("    Drive %d status unknown.\n"), dev->drive_index);
+         sendit(msg, len, arg);
       }
    }
    if (debug_level > 1) {
index 2bdf3fbbaa5a110e4031a3aee3f1131020be803d..e4bb4a226a907e657193500669664c2a8ca7dacd 100644 (file)
@@ -2,6 +2,9 @@
 
 General:
 08Sep06
+kes  Fix logic error in handling error return from mtx-changer 
+     script.
+kes  Make status from SD aware of -1 (unknown) Slot status.
 kes  At Eric's suggestion make both the "slots" and "drive" commands
      to the Storage daemon work even if the drive is busy.
 kes  Make two separate Win32 menu links for starting bconsole and