]> git.sur5r.net Git - bacula/bacula/commitdiff
Improve algorithm for detecting pre-reserved volume and
authorKern Sibbald <kern@sibbald.com>
Fri, 11 Apr 2008 09:36:22 +0000 (09:36 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 11 Apr 2008 09:36:22 +0000 (09:36 +0000)
     swapping volumes.

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

bacula/src/stored/mount.c
bacula/src/version.h
bacula/technotes-2.3

index 08b0b33d474c0b2a255aeb82fa334f209d54be5a..1edab43492ed3d598bff52ec9c00ef1e84782df7 100644 (file)
@@ -120,19 +120,28 @@ mount_next_vol:
       unload_dev(dcr, swap_dev);
       swap_dev = NULL;
       dev->vol->clear_swapping();
+      dev->VolHdr.VolumeName[0] = 0;  /* don't yet have right Volume */
    }
    if (!is_suitable_volume_mounted()) {
+      bool have_vol = false;
+      /* Do we have a candidate volume? */
+      if (dev->vol) {
+         bstrncpy(VolumeName, dev->vol->vol_name, sizeof(VolumeName));
+         have_vol = dir_get_volume_info(this, GET_VOL_INFO_FOR_WRITE);
+      }
       /*
        * Get Director's idea of what tape we should have mounted.
        *    in dcr->VolCatInfo
        */
-      Dmsg0(200, "Before dir_find_next_appendable_volume.\n");
-      while (!dir_find_next_appendable_volume(dcr)) {
-         Dmsg0(200, "not dir_find_next\n");
-         if (!dir_ask_sysop_to_create_appendable_volume(dcr)) {
-            goto bail_out;
-          }
-          Dmsg0(200, "Again dir_find_next_append...\n");
+      if (!have_vol) {
+         Dmsg0(200, "Before dir_find_next_appendable_volume.\n");
+         while (!dir_find_next_appendable_volume(dcr)) {
+            Dmsg0(200, "not dir_find_next\n");
+            if (job_canceled(jcr) || !dir_ask_sysop_to_create_appendable_volume(dcr)) {
+               goto bail_out;
+             }
+             Dmsg0(200, "Again dir_find_next_append...\n");
+         }
       }
    }
    if (job_canceled(jcr)) {
index 4029714c26e34da1912973ea20b8a10ca5e0c82a..1397b455bc04820996b187921790c21f744ed50d 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "2.3.18"
-#define BDATE   "10 April 2008"
-#define LSMDATE "10Apr08"
+#define BDATE   "11 April 2008"
+#define LSMDATE "11Apr08"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2008"       /* year for copyright messages in progs */
index a4fb85ceb83a6a4edfe098641e5ed51c95797fc7..fa0415574b80efcf79d3ccf749d8ac636f410d82 100644 (file)
@@ -24,6 +24,9 @@ Add long term statistics job table
 
 
 General:
+11Apr08
+kes  Improve algorithm for detecting pre-reserved volume and
+     swapping volumes.
 10Apr08
 kes  Tweak volume swapping code so it works.
 kes  Correct name overloading in mount.c