From: Kern Sibbald Date: Fri, 8 Sep 2006 13:38:53 +0000 (+0000) Subject: kes At Eric's suggestion make both the slots and drive commands X-Git-Tag: Release-7.0.0~7594 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4d4eae6f864d50846566a551b422155094b41240;p=bacula%2Fbacula kes At Eric's suggestion make both the slots and drive commands to the Storage daemon work even if the drive is busy. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3439 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index eb8fb36718..146cbfbe66 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -904,17 +904,21 @@ static bool changer_cmd(JCR *jcr) DCR *dcr; const char *cmd = NULL; bool ok = false; - bool dolist = false; + /* + * A safe_cmd may call autochanger script but does not load/unload + * slots so it can be done at the same time that the drive is open. + */ + bool safe_cmd = false; if (sscanf(dir->msg, "autochanger list %127s", devname.c_str()) == 1) { cmd = "list"; - dolist = ok = true; + safe_cmd = ok = true; } else if (sscanf(dir->msg, "autochanger slots %127s", devname.c_str()) == 1) { cmd = "slots"; - ok = true; + safe_cmd = ok = true; } else if (sscanf(dir->msg, "autochanger drives %127s", devname.c_str()) == 1) { cmd = "drives"; - ok = true; + safe_cmd = ok = true; } if (ok) { dcr = find_device(jcr, devname, -1); @@ -925,7 +929,7 @@ static bool changer_cmd(JCR *jcr) bnet_fsend(dir, _("3995 Device %s is not an autochanger.\n"), dev->print_name()); /* Under certain "safe" conditions, we can steal the lock */ - } else if (dolist || !dev->is_open() || dev->can_steal_lock()) { + } else if (safe_cmd || !dev->is_open() || dev->can_steal_lock()) { autochanger_cmd(dcr, dir, cmd); } else if (dev->is_busy() || dev->is_blocked()) { send_dir_busy_message(dir, dev); diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index 4ca576fe07..2bdf3fbbaa 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -2,6 +2,8 @@ General: 08Sep06 +kes At Eric's suggestion make both the "slots" and "drive" commands + to the Storage daemon work even if the drive is busy. kes Make two separate Win32 menu links for starting bconsole and wx-console in winbacula.nsi kes Apply DVD part_spooled patch from Richard Mortimer