]> git.sur5r.net Git - bacula/bacula/commitdiff
kes At Eric's suggestion make both the slots and drive commands
authorKern Sibbald <kern@sibbald.com>
Fri, 8 Sep 2006 13:38:53 +0000 (13:38 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 8 Sep 2006 13:38:53 +0000 (13:38 +0000)
     to the Storage daemon work even if the drive is busy.

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

bacula/src/stored/dircmd.c
bacula/technotes-1.39

index eb8fb3671874ffeba6c3259fa21b170c0748052e..146cbfbe66dc241d25ca235dddde175e0c0f7f29 100644 (file)
@@ -904,17 +904,21 @@ static bool changer_cmd(JCR *jcr)
    DCR *dcr;
    const char *cmd = NULL;
    bool ok = false;
-   bool dolist = false;
+   /*
+    * A safe_cmd may call autochanger script but does not load/unload
+    *    slots so it can be done at the same time that the drive is open.
+    */
+   bool safe_cmd = false;
 
    if (sscanf(dir->msg, "autochanger list %127s", devname.c_str()) == 1) {
       cmd = "list";
-      dolist = ok = true;
+      safe_cmd = ok = true;
    } else if (sscanf(dir->msg, "autochanger slots %127s", devname.c_str()) == 1) {
       cmd = "slots";
-      ok = true;
+      safe_cmd = ok = true;
    } else if (sscanf(dir->msg, "autochanger drives %127s", devname.c_str()) == 1) {
       cmd = "drives";
-      ok = true;
+      safe_cmd = ok = true;
    }
    if (ok) {
       dcr = find_device(jcr, devname, -1);
@@ -925,7 +929,7 @@ static bool changer_cmd(JCR *jcr)
             bnet_fsend(dir, _("3995 Device %s is not an autochanger.\n"), 
                dev->print_name());
          /* Under certain "safe" conditions, we can steal the lock */
-         } else if (dolist || !dev->is_open() || dev->can_steal_lock()) {
+         } else if (safe_cmd || !dev->is_open() || dev->can_steal_lock()) {
             autochanger_cmd(dcr, dir, cmd);
          } else if (dev->is_busy() || dev->is_blocked()) {
             send_dir_busy_message(dir, dev);
index 4ca576fe07bbe32067836214c6e2cab89db44d74..2bdf3fbbaa5a110e4031a3aee3f1131020be803d 100644 (file)
@@ -2,6 +2,8 @@
 
 General:
 08Sep06
+kes  At Eric's suggestion make both the "slots" and "drive" commands
+     to the Storage daemon work even if the drive is busy.
 kes  Make two separate Win32 menu links for starting bconsole and
      wx-console in winbacula.nsi
 kes  Apply DVD part_spooled patch from Richard Mortimer