]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Locking debug level tweaks in SD.
authorKern Sibbald <kern@sibbald.com>
Thu, 12 Apr 2007 16:19:42 +0000 (16:19 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 12 Apr 2007 16:19:42 +0000 (16:19 +0000)
kes  Tweak new Volume code.

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

bacula/src/qt-console/bat.conf.in [new file with mode: 0644]
bacula/src/stored/reserve.c
bacula/technotes-2.1

diff --git a/bacula/src/qt-console/bat.conf.in b/bacula/src/qt-console/bat.conf.in
new file mode 100644 (file)
index 0000000..fcce04e
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# Bacula Administration Tool (bat) configuration file
+#
+
+Director {
+  Name = @hostname@-dir
+  DIRport = @dir_port@
+  address = @hostname@
+  Password = "@dir_password@"
+}
index bc590e210ad2a010bc1882951b76104cd38cfbd9..793f2a0b2b1e17b03acec284227c39656d5bd6f3 100644 (file)
@@ -202,6 +202,9 @@ static VOLRES *new_vol_item(DCR *dcr, const char *VolumeName)
 static void free_vol_item(VOLRES *vol)
 {
    free(vol->vol_name);
+   if (vol->dev) {
+      vol->dev->vol = NULL;
+   }
    free(vol);
 }
 
@@ -316,16 +319,24 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName)
        */
       Dmsg3(100, "reserve_vol free-tmp vol=%s at %p JobId=%u\n", vol->vol_name,
             vol->vol_name, (int)dcr->jcr->JobId);
+      /*
+       * Clear dev pointer so that free_vol_item() doesn't 
+       *  take away our volume. 
+       */
+      nvol->dev = NULL;                   /* don't zap dev entry */
       free_vol_item(nvol);
 
       /* 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 */
-         if (!dev->is_busy()) {
-            /* OK to move it */
+         if (!vol->dev->is_busy()) {
+            /* OK to move it -- I'm not sure this will work */
             Dmsg3(100, "Swap vol=%s from dev=%s to %s\n", VolumeName,
                dev->print_name(), dev->print_name());
-            vol->dev = dev;
+            vol->dev->vol = NULL;         /* take vol from old drive */
+            vol->dev->VolHdr.VolumeName[0] = 0;
+            vol->dev = dev;               /* point vol at new drive */
+            dev->vol = vol;               /* point dev at vol */
             dev->VolHdr.VolumeName[0] = 0;
          } else {
             vol = NULL;                /* device busy */
index 37c7bd8dd83a3e46922f9ea04de88d1f795b0d40..2172a3a94b67a2c7b00d67240993f93145d83e65 100644 (file)
@@ -3,6 +3,7 @@
 General:
 12Apr07
 kes  Locking debug level tweaks in SD.
+kes  Tweak new Volume code.
 11Apr07
 kes  Add exec external-command [wait-seconds] to bconsole. This
      executes the external-command.  Note! normally external-command