]> git.sur5r.net Git - bacula/bacula/commitdiff
Tweak swap code
authorKern Sibbald <kern@sibbald.com>
Wed, 12 Mar 2008 20:52:51 +0000 (20:52 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 12 Mar 2008 20:52:51 +0000 (20:52 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6593 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/askdir.c
bacula/src/stored/reserve.c

index 6d1d2ce823ff6e37e86d6042f1eb0e2118325f3f..b964455c7ede1170aa988c56e973e92e3d715428 100644 (file)
@@ -274,7 +274,7 @@ bool dir_find_next_appendable_volume(DCR *dcr)
        bool ok = do_get_volume_info(dcr);
        if (ok) {
           if (!is_volume_in_use(dcr)) {
-             Dmsg0(400, "dir_find_next_appendable_volume return true\n");
+             Dmsg1(100, "Attempt reserve. Vol=%s\n", dcr->VolumeName);
              if (reserve_volume(dcr, dcr->VolumeName) == 0) {
                 Dmsg2(100, "Could not reserve volume %s on %s\n", dcr->VolumeName,
                     dcr->dev->print_name());
@@ -282,6 +282,8 @@ bool dir_find_next_appendable_volume(DCR *dcr)
              }
              V(vol_info_mutex);
              unlock_reservations();
+             Dmsg1(100, "dir_find_next_appendable_volume return true. vol=%s\n",
+                dcr->VolumeName);
              return true;
           } else {
              Dmsg1(100, "Volume %s is in use.\n", dcr->VolumeName);
index 1aafd357f047cf937c00ae1ef08d333a6d7472bc..2e21cf9bf35f0a6d9376d06990aba7ba2af0cd3b 100644 (file)
@@ -380,8 +380,11 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName)
       /* Check if we are trying to use the Volume on a different drive */
       if (dev != vol->dev) {
          /* Caller wants to switch Volume to another device */
+         Dmsg2(dbglvl, "==== Swap from dev=%s to %s\n",
+               dev->print_name(), vol->dev->print_name());
          switch_device(dcr, vol->dev);
          dev = vol->dev;
+         bstrncpy(dcr->VolumeName, VolumeName, sizeof(dcr->VolumeName));
 #ifdef xxx
          if (!vol->dev->is_busy()) {
             /* OK to move it -- I'm not sure this will work */