From: Kern Sibbald Date: Wed, 6 Jul 2005 13:24:07 +0000 (+0000) Subject: - Modify mtx-changer.in script to return slot:barcode for X-Git-Tag: Release-7.0.0~8654 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2dfa2c7b55a9555b3ef5f31ecd9e60e641a24a7e;p=bacula%2Fbacula - 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. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2177 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index dd12b3177c..13c4b5fcb9 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -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. diff --git a/bacula/scripts/mtx-changer.in b/bacula/scripts/mtx-changer.in index 27ac5e154d..adf500ca99 100644 --- a/bacula/scripts/mtx-changer.in +++ b/bacula/scripts/mtx-changer.in @@ -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) diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index ecc2b14402..5b55b91233 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -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); diff --git a/bacula/src/version.h b/bacula/src/version.h index 531f974a0f..0a50102e8c 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -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