]> git.sur5r.net Git - bacula/bacula/commitdiff
- Modify mtx-changer.in script to return slot:barcode for
authorKern Sibbald <kern@sibbald.com>
Wed, 6 Jul 2005 13:24:07 +0000 (13:24 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 6 Jul 2005 13:24:07 +0000 (13:24 +0000)
  Volumes that are loaded in the drives.
- Correct some more places where dev->is_blocked() needs
  to be checked in dircmd.c in SD.
- Update doc.

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

bacula/kes-1.37
bacula/scripts/mtx-changer.in
bacula/src/stored/dircmd.c
bacula/src/version.h

index dd12b3177c8f194da591b1b14fac5c258e9cdd0c..13c4b5fcb9a4f018c16cba6deaef58b3679830df 100644 (file)
@@ -4,6 +4,12 @@
 General:
 
 Changes to 1.37.28:
+06Jul05
+- Modify mtx-changer.in script to return slot:barcode for
+  Volumes that are loaded in the drives.
+- Correct some more places where dev->is_blocked() needs
+  to be checked in dircmd.c in SD.
+- Update doc.
 05Jul05
 - Add code to ensure that reserved but unused volumes
   are freed. 
index 27ac5e154d9128c2a229792aa4e2b15ca190e647..adf500ca99f9706f33b07bd6d81e72b9c26af257 100644 (file)
@@ -129,13 +129,15 @@ case $cmd in
 
    list) 
 #     echo "Doing mtx -f $ctl -- to list volumes"
-      ${MTX} -f $ctl status | grep " *Storage Element [0-9]*:.*Full" | awk "{print \$3 \$4}" | sed "s/Full *\(:VolumeTag=\)*//"
-# Comment out the previous line and add a line here
-# to print "fake" barcodes.
+      ${MTX} -f $ctl status >${TMPDIR}/mtx.$$
+      rtn=$?
+      cat ${TMPDIR}/mtx.$$ | grep " *Storage Element [0-9]*:.*Full" | awk "{print \$3 \$4}" | sed "s/Full *\(:VolumeTag=\)*//"
+      cat ${TMPDIR}/mtx.$$ | grep "^Data Transfer Element [0-9]*:Full (Storage Element [0-9]*Loaded" | awk '{printf "%s:%s\n",$7,$10}'
 #
 # If you have a VXA PacketLoader and the above does not work, try
 #  turning it off and enabling the following line.
 #     ${MTX} -f $ctl status | grep " *Storage Element [0-9]*:.*Full" | sed "s/*Storage Element //" | sed "s/Full :VolumeTag=//"
+      exit $rtn
       ;;
 
    loaded)
index ecc2b14402b3395426bba18592e7b4593dad9f98..5b55b91233f95e83ce039a04be71e211054eb50f 100644 (file)
@@ -475,7 +475,6 @@ static DEVICE *find_device(JCR *jcr, POOL_MEM &devname)
    bool found = false;
 
    unbash_spaces(devname);
-// LockRes();
    foreach_res(device, R_DEVICE) {
       /* Find resource, and make sure we were able to open it */
       if (fnmatch(device->hdr.name, devname.c_str(), 0) == 0) {
@@ -522,11 +521,9 @@ static DEVICE *find_device(JCR *jcr, POOL_MEM &devname)
 
    if (found) {
       jcr->dcr = new_dcr(jcr, device->dev);
-//    UnlockRes();
       jcr->dcr->device = device;
       return jcr->dcr->dev;
    }
-// UnlockRes();
    return NULL;
 }
 
@@ -809,7 +806,7 @@ static bool autochanger_cmd(JCR *jcr)
          /* Under certain "safe" conditions, we can steal the lock */
          } else if (dev->can_steal_lock()) {
             autochanger_cmd(dcr, dir, cmd);
-         } else if (dev->is_busy()) {
+         } else if (dev->is_busy() || dev->is_blocked()) {
             send_dir_busy_message(dir, dev);
          } else {                     /* device not being used */
             autochanger_cmd(dcr, dir, cmd);
@@ -847,7 +844,7 @@ static bool readlabel_cmd(JCR *jcr)
          /* Under certain "safe" conditions, we can steal the lock */
          } else if (dev->can_steal_lock()) {
             read_volume_label(jcr, dev, Slot);
-         } else if (dev->is_busy()) {
+         } else if (dev->is_busy() || dev->is_blocked()) {
             send_dir_busy_message(dir, dev);
          } else {                     /* device not being used */
             read_volume_label(jcr, dev, Slot);
index 531f974a0f71869b79cf9aa6a78853079803d8c2..0a50102e8c17bcca66a3ce1c1597d026450d9d23 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #undef  VERSION
 #define VERSION "1.37.28"
-#define BDATE   "05 July 2005"
-#define LSMDATE "05Jul05"
+#define BDATE   "06 July 2005"
+#define LSMDATE "06Jul05"
 
 /* Debug flags */
 #undef  DEBUG