]> git.sur5r.net Git - bacula/bacula/commitdiff
Implement AutomaticMount
authorKern Sibbald <kern@sibbald.com>
Thu, 17 Apr 2003 22:13:47 +0000 (22:13 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 17 Apr 2003 22:13:47 +0000 (22:13 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@448 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/stored/dev.c
bacula/src/stored/mount.c
bacula/src/stored/stored.c
bacula/src/version.h

index 5cc3a825ad6ee8a137876309b68afba5c572e845..d94067002cc8c5ebd8370c86f72ee8a1b30f7cc1 100644 (file)
@@ -19,6 +19,7 @@ Testing to do: (painful)
 For 1.30 release:
 - Fix Bare Metal restore problem.
 - Implement create "FileSet"?
+- Possibly implement a Slot priority (loaded/not loaded).
 - Test multiple simultaneous Volumes
 
 - Document new transparent Console commands and wait command.
@@ -961,4 +962,3 @@ rufus-dir: Volume used once. Marking Volume "File0003" as Used.
   the binary gets deleted when the daemon is stopped in the
   rc.d/inid.d directory.
 - Do not ignore SIGCHLD
-
index e2228768825c71fa0afcd404ccad3baf3d5de3dd..0b5a831bebd414bcebb07a7d041db18e7484c5e7 100644 (file)
@@ -286,7 +286,7 @@ open_dev(DEVICE *dev, char *VolName, int mode)
       Dmsg1(29, "open_dev: tape %d opened\n", dev->fd);
    } else {
       /*
-       * Handle opening of file
+       * Handle opening of File Archive (not a tape)
        */
       archive_name = get_pool_memory(PM_FNAME);
       pm_strcpy(&archive_name, dev->dev_name);
index 1d5905f043b52ea5d5312b0a38ab6f0f5e0e6861..420eb488e88a6dcc047ee2dfdac2988074ddb298 100644 (file)
@@ -103,7 +103,6 @@ mount_next_vol:
    }
    Dmsg2(100, "After find_next_append. Vol=%s Slot=%d\n",
         jcr->VolCatInfo.VolCatName, jcr->VolCatInfo.Slot);
-   release = 1;                       /* release if we "recurse" */
 
    /* 
     * Get next volume and ready it for append
@@ -127,10 +126,19 @@ mount_next_vol:
    for ( ;; ) {
       int vol_label_status;
       autochanger = autoload_device(jcr, dev, 1, NULL);
-      if (autochanger) {
-        ask = 0;                     /* if autochange no need to ask sysop */
+
+      /*
+       * If we autochanged to correct Volume or (we have not just
+       *   released the Volume AND we can automount) we go ahead 
+       *   and read the label. If there is no tape in the drive,
+       *   we will err, recurse and ask the operator the next time.
+       */
+      if (autochanger || (!release && dev_cap(dev, CAP_AUTOMOUNT))) {
+         ask = 0;                     /* don't ask SYSOP this time */
       }
 
+      release = 1;                    /* release next time if we "recurse" */
+
       if (ask && !dir_ask_sysop_to_mount_next_volume(jcr, dev)) {
          Dmsg0(100, "Error return ask_sysop ...\n");
         return 0;              /* error return */
@@ -138,7 +146,7 @@ mount_next_vol:
       Dmsg1(100, "want vol=%s\n", jcr->VolumeName);
 
       /* Open device */
-      for ( ; !(dev->state & ST_OPENED); ) {
+      if  (!(dev->state & ST_OPENED)) {
          int mode;
          if (dev_cap(dev, CAP_STREAM)) {
             mode = OPEN_WRITE_ONLY;
index 615d941962ee4e7c757932fea967982447e2ab70..8d2868bb7f2fad838fff44319c8737da4d0b9d7b 100644 (file)
@@ -310,6 +310,7 @@ static void *device_allocation(void *arg)
       Dmsg1(10, "SD init done %s\n", device->device_name);
       if (!device->dev) {
          Emsg1(M_ERROR, 0, _("Could not initialize %s\n"), device->device_name);
+        continue;
       }
       if (device->cap_bits & CAP_ALWAYSOPEN) {
          Dmsg1(20, "calling open_device %s\n", device->device_name);
index 4d19a9cccebd3fb4ce35193ec36559046f7894e8..01e6a176ef53b209b7f2d69b02d8e72b06aad526 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #define VERSION "1.30"
 #define VSTRING "1"
-#define BDATE   "16 April 2003"
-#define LSMDATE "16Apr03"
+#define BDATE   "18 April 2003"
+#define LSMDATE "18Apr03"
 
 /* Debug flags */
 #define DEBUG 1