From 3ac48ea68054a09fee22653b3d612faff647ba6a Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 8 Sep 2006 21:10:22 +0000 Subject: [PATCH] kes Fix logic error in handling error return from mtx-changer script. kes Make status from SD aware of -1 (unknown) Slot status. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3442 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/autochanger.c | 6 ++++-- bacula/src/stored/status.c | 7 +++++-- bacula/technotes-1.39 | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c index 65549cfe70..5de6cb60b0 100644 --- a/bacula/src/stored/autochanger.c +++ b/bacula/src/stored/autochanger.c @@ -332,8 +332,9 @@ bool unload_autochanger(DCR *dcr, int loaded) Jmsg(jcr, M_INFO, 0, _("3995 Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n"), slot, dev->drive_index, be.strerror()); ok = false; + dev->Slot = -1; /* unknown */ } else { - dev->Slot = -1; /* unknown */ + dev->Slot = 0; /* nothing loaded */ } free_pool_memory(changer); unlock_changer(dcr); @@ -431,8 +432,9 @@ static bool unload_other_drive(DCR *dcr, int slot) Dmsg3(100, "Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n", slot, dev->drive_index, be.strerror()); ok = false; + dev->Slot = -1; /* unknown */ } else { - dev->Slot = -1; /* nothing loaded */ + dev->Slot = 0; /* nothing loaded */ Dmsg0(100, "Slot unloaded\n"); } unlock_changer(dcr); diff --git a/bacula/src/stored/status.c b/bacula/src/stored/status.c index b21d277911..db3a2c4c5e 100644 --- a/bacula/src/stored/status.c +++ b/bacula/src/stored/status.c @@ -256,13 +256,16 @@ static void send_blocked_status(DEVICE *dev, void sendit(const char *msg, int le } /* Send autochanger slot status */ if (dev->is_autochanger()) { - if (dev->Slot) { + if (dev->Slot > 0) { len = Mmsg(msg, _(" Slot %d is loaded in drive %d.\n"), dev->Slot, dev->drive_index); sendit(msg, len, arg); - } else { + } else if (dev->Slot == 0) { len = Mmsg(msg, _(" Drive %d is not loaded.\n"), dev->drive_index); sendit(msg, len, arg); + } else { + len = Mmsg(msg, _(" Drive %d status unknown.\n"), dev->drive_index); + sendit(msg, len, arg); } } if (debug_level > 1) { diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index 2bdf3fbbaa..e4bb4a226a 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -2,6 +2,9 @@ General: 08Sep06 +kes Fix logic error in handling error return from mtx-changer + script. +kes Make status from SD aware of -1 (unknown) Slot status. 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 -- 2.39.5