From 140437f1a0478117e8059eb25d4ba62bd7515b98 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 20 Jun 2008 18:39:49 +0000 Subject: [PATCH] Fix bug where SD did not ask operator if the device could not be opened. Reported by Eric. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7201 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/mount.c | 10 ++++++++-- bacula/technotes-2.5 | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 98c3b80b3e..26d0cb224f 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -159,6 +159,7 @@ mount_next_vol: } else { autochanger = false; VolCatInfo.Slot = 0; + ask = true; } Dmsg1(150, "autoload_dev returns %d\n", autochanger); /* @@ -177,7 +178,6 @@ mount_next_vol: ask = false; } Dmsg2(150, "Ask=%d autochanger=%d\n", ask, autochanger); - dev->must_unload(); /* release next time if we "recurse" */ if (ask && !dir_ask_sysop_to_mount_volume(dcr, ST_APPEND)) { Dmsg0(150, "Error return ask_sysop ...\n"); @@ -225,15 +225,20 @@ mount_next_vol: if (try_autolabel(false) == try_read_vol) { break; /* created a new volume label */ } + dev->set_unload(); /* force ask sysop */ + ask = true; + goto mount_next_vol; +#ifdef xxx /* If DVD, ignore the error, very often you cannot open the device * (when there is no DVD, or when the one inserted is a wrong one) */ if (dev->poll || dev->is_dvd()) { goto mount_next_vol; } else { - Jmsg(jcr, M_ERROR, 0, _("Could not open device %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Could not open device %s: ERR=%s\n"), dev->print_name(), dev->print_errmsg()); goto bail_out; } +#endif } /* @@ -243,6 +248,7 @@ read_volume: switch (check_volume_label(ask, autochanger)) { case check_next_vol: + dev->set_unload(); /* want a different Volume */ goto mount_next_vol; case check_read_vol: goto read_volume; diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 37c7447d06..85c7650445 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -32,6 +32,8 @@ vtape driver General: 20Jun08 kes More word alignment cleanup. +kes Fix bug where SD did not ask operator if the device could not + be opened. Reported by Eric. 19Jun08 kes Add dbuser to DIR conf file (replaces user). kes Add --with-db-password to ./configure -- 2.39.5