Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Bacula® is a registered trademark of John Walker.
+ Bacula® is a registered trademark of Kern Sibbald.
The licensor of Bacula is the Free Software Foundation Europe
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
if (jcr->job->PruneJobs || jcr->client->AutoPrune) {
Jmsg(jcr, M_INFO, 0, _("Begin pruning Jobs.\n"));
- prune_jobs(ua, client, jcr->JobType);
+ prune_jobs(ua, client, jcr->get_JobType());
pruned = true;
} else {
pruned = false;
prune_list.num_ids = 0; /* reset count */
}
ok = is_volume_purged(ua, &lmr);
+
+ /*
+ * Check if this volume is available (InChanger + StorageId)
+ * If not, just skip this volume and try the next one
+ */
+ if (ok && InChanger) {
+ if (!lmr.InChanger || (lmr.StorageId != mr->StorageId)) {
+ ok = false; /* skip this volume, ie not loadable */
+ }
+ }
+
/*
* If purged and not moved to another Pool,
* then we stop pruning and take this volume.
*/
if (ok && lmr.PoolId == mr->PoolId) {
Dmsg2(050, "Vol=%s MediaId=%d purged.\n", lmr.VolumeName, (int)lmr.MediaId);
- mr = &lmr; /* struct copy */
+ memcpy(mr, &lmr, sizeof(lmr));
break; /* got a volume */
}
/*