From: Kern Sibbald Date: Thu, 10 Apr 2008 18:25:56 +0000 (+0000) Subject: Tweak volume swapping code so it works. X-Git-Tag: Release-7.0.0~4725 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fd2840452531786aaee7633a07bf4db238d8a249;p=bacula%2Fbacula Tweak volume swapping code so it works. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6792 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c index 3416c63291..a6f37b6716 100644 --- a/bacula/src/stored/autochanger.c +++ b/bacula/src/stored/autochanger.c @@ -436,7 +436,7 @@ bool unload_dev(DCR *dcr, DEVICE *dev) DEVICE *save_dev; int save_slot; - if (!changer) { + if (!changer || dev->Slot <= 0) { return false; } dev->dlock(); diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index ed7fd6bf54..08b0b33d47 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -114,6 +114,7 @@ mount_next_vol: * volume to our drive. */ if (swap_dev) { + Dmsg1(150, "Swap vol=%d\n", swap_dev->vol->vol_name); dev->vol = swap_dev->vol; /* take its volume */ swap_dev->vol = NULL; unload_dev(dcr, swap_dev); diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index 3d5455669e..d1fce56d97 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -402,9 +402,12 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName) vol = NULL; /* device busy */ goto get_out; } + } else { + dev->vol = vol; } + } else { + dev->vol = vol; /* point to newly inserted volume */ } - dev->vol = vol; get_out: if (vol) { diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 3e47d4dc13..a4fb85ceb8 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -25,6 +25,7 @@ Add long term statistics job table General: 10Apr08 +kes Tweak volume swapping code so it works. kes Correct name overloading in mount.c kes Replace released flag in VOLRES with reserved and add access methods for the VOLRES class.