From 92c088e0b3d663d25ada5afe1d171ffb33e831a7 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 12 Mar 2008 20:52:51 +0000 Subject: [PATCH] Tweak swap code git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6593 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/askdir.c | 4 +++- bacula/src/stored/reserve.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index 6d1d2ce823..b964455c7e 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -274,7 +274,7 @@ bool dir_find_next_appendable_volume(DCR *dcr) bool ok = do_get_volume_info(dcr); if (ok) { if (!is_volume_in_use(dcr)) { - Dmsg0(400, "dir_find_next_appendable_volume return true\n"); + Dmsg1(100, "Attempt reserve. Vol=%s\n", dcr->VolumeName); if (reserve_volume(dcr, dcr->VolumeName) == 0) { Dmsg2(100, "Could not reserve volume %s on %s\n", dcr->VolumeName, dcr->dev->print_name()); @@ -282,6 +282,8 @@ bool dir_find_next_appendable_volume(DCR *dcr) } V(vol_info_mutex); unlock_reservations(); + Dmsg1(100, "dir_find_next_appendable_volume return true. vol=%s\n", + dcr->VolumeName); return true; } else { Dmsg1(100, "Volume %s is in use.\n", dcr->VolumeName); diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index 1aafd357f0..2e21cf9bf3 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -380,8 +380,11 @@ VOLRES *reserve_volume(DCR *dcr, const char *VolumeName) /* Check if we are trying to use the Volume on a different drive */ if (dev != vol->dev) { /* Caller wants to switch Volume to another device */ + Dmsg2(dbglvl, "==== Swap from dev=%s to %s\n", + dev->print_name(), vol->dev->print_name()); switch_device(dcr, vol->dev); dev = vol->dev; + bstrncpy(dcr->VolumeName, VolumeName, sizeof(dcr->VolumeName)); #ifdef xxx if (!vol->dev->is_busy()) { /* OK to move it -- I'm not sure this will work */ -- 2.39.5