]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Enhance a couple of SD debug messages.
authorKern Sibbald <kern@sibbald.com>
Sat, 24 May 2008 09:31:05 +0000 (09:31 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 24 May 2008 09:31:05 +0000 (09:31 +0000)
kes  Tweak unload flag setting and ensure it is set during swap.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@7014 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/autochanger.c
bacula/src/stored/dircmd.c
bacula/src/stored/mount.c
bacula/src/stored/reserve.c
bacula/src/version.h
bacula/technotes-2.1

index 28caffb45340cafc082a537844c4d4107df9659d..0dc882c63193089ae1c7ea1548064ea4b2d6f72c 100644 (file)
@@ -186,7 +186,7 @@ int autoload_device(DCR *dcr, int writing, BSOCK *dir)
           * Load the desired cassette
           */
          lock_changer(dcr);
-         Dmsg1(100, "Doing changer load slot %d\n", slot);
+         Dmsg2(100, "Doing changer load slot %d %s\n", slot, dev->print_name());
          Jmsg(jcr, M_INFO, 0,
               _("3304 Issuing autochanger \"load slot %d, drive %d\" command.\n"),
               slot, drive);
@@ -337,6 +337,7 @@ bool unload_autochanger(DCR *dcr, int loaded)
 
    /* Virtual disk autochanger */
    if (dcr->device->changer_command[0] == 0) {
+      dev->clear_unload();
       return true;
    }
 
@@ -370,12 +371,12 @@ bool unload_autochanger(DCR *dcr, int loaded)
       } else {
          dev->Slot = 0;            /* nothing loaded */
       }
-      dev->clear_unload();
       unlock_changer(dcr);
 
       free_volume(dev);            /* Free any volume associated with this drive */
       free_pool_memory(changer);
    }
+   dev->clear_unload();
    return ok;
 }
 
@@ -480,8 +481,8 @@ bool unload_dev(DCR *dcr, DEVICE *dev)
       ok = false;
       dev->Slot = -1;          /* unknown */
    } else {
+      Dmsg2(100, "Slot %d unloaded %s\n", dev->Slot, dev->print_name());
       dev->Slot = 0;           /* nothing loaded */
-      Dmsg0(100, "Slot unloaded\n");
    }
    dev->clear_unload();
    unlock_changer(dcr);
index 9387a4ac29b5518acc55849d16dec11f6817327f..5891d6d0ec05ac13a6ba4031db1a0b97264d4274 100644 (file)
@@ -917,7 +917,6 @@ static bool release_cmd(JCR *jcr)
             send_dir_busy_message(dir, dev);
          } else {                     /* device not being used */
             Dmsg0(90, "Device not in use, releasing\n");
-            unload_autochanger(dcr, -1);
             dcr->release_volume();
             dir->fsend(_("3022 Device %s released.\n"), 
                dev->print_name());
index 2f292de2091c3d28fd4cd36e465ac069f61ee6ce..58464b696e0aeb9df1190f0fdcf593589f686bc8 100644 (file)
@@ -474,7 +474,6 @@ void DCR::do_swapping(bool is_writing)
 {
    if (dev->must_unload()) {
       Dmsg1(100, "swapping: unloading %s\n", dev->print_name());
-      unload_autochanger(this, -1);
       release_volume();
       dev->clear_unload();
    }
@@ -670,6 +669,8 @@ void DCR::mark_volume_not_inchanger()
  */
 void DCR::release_volume()
 {
+   unload_autochanger(this, -1);
+   
    if (WroteVol) {
       Jmsg0(jcr, M_ERROR, 0, _("Hey!!!!! WroteVol non-zero !!!!!\n"));
       Dmsg0(190, "Hey!!!!! WroteVol non-zero !!!!!\n");
index 99de0a72f84e25bdd253a0e4d09fe469415635ec..90d65af51a0f60365a93c9e813466e0b95efee12 100644 (file)
@@ -189,17 +189,6 @@ void debug_list_volumes(const char *imsg)
       Dmsg2(dbglvl, "jid=%u %s", jid(), msg.c_str());
    }
 
-#ifdef xxx
-   DEVICE *dev = NULL;
-   foreach_dlist(vol, vol_list) {
-      if (vol->dev == dev) {
-         Dmsg0(dbglvl, "Two Volumes on same device.\n");
-         ASSERT(0);
-         dev = vol->dev;
-      }
-   }
-#endif
-
    unlock_volumes();
 }
 
@@ -360,6 +349,7 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName)
          }
          Dmsg3(dbglvl, "jid=%u reserve_vol free vol=%s at %p\n", jid(), vol->vol_name, vol->vol_name);
          free_volume(dev);
+//       volume_unused(dcr);
          dev->set_unload();             /* have to unload current volume */
          debug_list_volumes("reserve_vol free");
       }
@@ -400,8 +390,10 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName)
             Dmsg4(dbglvl, "==== jid=%u Swap vol=%s from dev=%s to %s\n", jid(),
                VolumeName, vol->dev->print_name(), dev->print_name());
             free_volume(dev);            /* free any volume attached to our drive */
+//          volume_unused(dcr);
+            dev->set_unload();           /* Unload any volume that is on our drive */
             dcr->dev = vol->dev;         /* temp point to other dev */
-            slot = get_autochanger_loaded_slot(dcr);  /* get slot */
+            slot = get_autochanger_loaded_slot(dcr);  /* get slot on other drive */
             dcr->dev = dev;              /* restore dev */
             vol->set_slot(slot);         /* save slot */
             vol->dev->set_unload();      /* unload the other drive */
@@ -602,7 +594,7 @@ bool free_volume(DEVICE *dev)
    if (!vol->is_swapping()) {
       dev->vol = NULL;
       vol_list->remove(vol);
-      Dmsg3(dbglvl, "jid=%u === free_volume %s dev=%s\n", jid(), vol->vol_name, dev->print_name());
+      Dmsg3(dbglvl, "jid=%u === remove volume %s dev=%s\n", jid(), vol->vol_name, dev->print_name());
       free_vol_item(vol);
       debug_list_volumes("free_volume");
    }
index 8a7426aeb28138d475faefe72aecb4c247f32fc7..32f188bdec06d30c987aa07b25637d73f455021d 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "2.2.10-b4"
-#define BDATE   "21 May 2008"
-#define LSMDATE "21May08"
+#define BDATE   "24 May 2008"
+#define LSMDATE "24May08"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2008"       /* year for copyright messages in progs */
index 89826094ab8d6ae0f1c89878f7e2341531db929e..c9304d218dff01eb11347f197b935a13b19b23e5 100644 (file)
@@ -2,6 +2,9 @@
 
 General:
 
+24May08
+kes  Enhance a couple of SD debug messages.
+kes  Tweak unload flag setting and ensure it is set during swap.
 23May08
 ebl  Fix #1091 about bad output in estimate command.
 21May08