Commit 258c329a authored by Steven Murray's avatar Steven Murray
Browse files

bug #104608: RFE: Remove the initial state column from TPCONFIG

Removed the initial state column from the TPCONFIG file for both the
taped and tapeserverd daemons.
parent 410b21ff
......@@ -107,7 +107,7 @@ void castor::tape::tapeserver::daemon::DriveCatalogue::enterTpconfigLine(
entry.dgn = line.dgn;
entry.devFilename = line.devFilename;
entry.densities.push_back(line.density);
entry.state = initial2DriveState(line.initialState);
entry.state = DRIVE_STATE_DOWN;
entry.librarySlot = line.librarySlot;
entry.devType = line.devType;
m_drives[line.unitName] = entry;
......@@ -123,32 +123,6 @@ void castor::tape::tapeserver::daemon::DriveCatalogue::enterTpconfigLine(
}
}
//-----------------------------------------------------------------------------
// initial2DriveState
//-----------------------------------------------------------------------------
castor::tape::tapeserver::daemon::DriveCatalogue::DriveState
castor::tape::tapeserver::daemon::DriveCatalogue::initial2DriveState(
const utils::TpconfigLine::InitialState initialState) const {
switch(initialState) {
case utils::TpconfigLine::TPCONFIG_DRIVE_NONE:
{
castor::exception::Exception ex;
ex.getMessage() << "Failed to convert initial drive state"
": TPCONFIG_DRIVE_NONE is invalid";
throw ex;
}
case utils::TpconfigLine::TPCONFIG_DRIVE_UP: return DRIVE_STATE_UP;
case utils::TpconfigLine::TPCONFIG_DRIVE_DOWN: return DRIVE_STATE_DOWN;
default:
{
castor::exception::Exception ex;
ex.getMessage() << "Failed to convert initial drive state"
": Unknown initial drive state: initialState=" << initialState;
throw ex;
}
}
}
//-----------------------------------------------------------------------------
// checkTpconfigLine
//-----------------------------------------------------------------------------
......@@ -158,7 +132,6 @@ void castor::tape::tapeserver::daemon::DriveCatalogue::checkTpconfigLine(
checkTpconfigLineDgn(catalogueEntry.dgn, line);
checkTpconfigLineDevFilename(catalogueEntry.devFilename, line);
checkTpconfigLineDensity(catalogueEntry.densities, line);
checkTpconfigLineInitialState(catalogueEntry.state, line);
checkTpconfigLineLibrarySlot(catalogueEntry.librarySlot, line);
checkTpconfigLineDevType(catalogueEntry.devType, line);
}
......@@ -212,22 +185,6 @@ void castor::tape::tapeserver::daemon::DriveCatalogue::checkTpconfigLineDensity(
}
}
//-----------------------------------------------------------------------------
// checkTpconfigLineInitialState
//-----------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::DriveCatalogue::
checkTpconfigLineInitialState(const DriveState catalogueInitialState,
const utils::TpconfigLine &line) {
if(catalogueInitialState != initial2DriveState(line.initialState)) {
castor::exception::Exception ex;
ex.getMessage() << "Invalid TPCONFIG line"
": A tape drive can only have one initial state"
": catalogueInitialState=" << catalogueInitialState <<
" lineInitialState=" << line.initialState;
throw ex;
}
}
//-----------------------------------------------------------------------------
// checkTpconfigLineLibrarySlot
//-----------------------------------------------------------------------------
......
......@@ -626,18 +626,6 @@ private:
*/
void enterTpconfigLine(const utils::TpconfigLine &line) ;
/**
* Converts the specified TPCONFIG initial drive-state to a drive-catalogue
* drive-state.
*
* This method throws an exception if the conversion fails.
*
* @param initialState The TPCONFIG initial drive-state.
* @return The drive-catalogue drive-state.
*/
DriveState initial2DriveState(
const utils::TpconfigLine::InitialState initialState) const;
/**
* Checks the semantics of the specified TPCONFIG line against the specified
* current catalogue entry.
......
......@@ -61,13 +61,13 @@ TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest, goodDayPopulate) {
castor::tape::utils::TpconfigLines lines;
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN1", "DEV1", "DEN11", "down", "SLOT1", "DEVTYPE1"));
"UNIT1", "DGN1", "DEV1", "DEN11", "SLOT1", "DEVTYPE1"));
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN1", "DEV1", "DEN12", "down", "SLOT1", "DEVTYPE1"));
"UNIT1", "DGN1", "DEV1", "DEN12", "SLOT1", "DEVTYPE1"));
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT2", "DGN2", "DEV2", "DEN21", "up", "SLOT2", "DEVTYPE2"));
"UNIT2", "DGN2", "DEV2", "DEN21", "SLOT2", "DEVTYPE2"));
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT2", "DGN2", "DEV2", "DEN22", "up", "SLOT2", "DEVTYPE2"));
"UNIT2", "DGN2", "DEV2", "DEN22", "SLOT2", "DEVTYPE2"));
DriveCatalogue catalogue;
ASSERT_NO_THROW(catalogue.populateCatalogue(lines));
......@@ -154,7 +154,7 @@ TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest, goodDayPopulate) {
{
DriveCatalogue::DriveState fromCatalogue = DriveCatalogue::DRIVE_STATE_INIT;
ASSERT_NO_THROW(fromCatalogue = catalogue.getState("UNIT2"));
ASSERT_EQ(DriveCatalogue::DRIVE_STATE_UP, fromCatalogue);
ASSERT_EQ(DriveCatalogue::DRIVE_STATE_DOWN, fromCatalogue);
}
{
......@@ -176,24 +176,9 @@ TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest,
castor::tape::utils::TpconfigLines lines;
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN1", "DEV", "DEN1", "down", "SLOT", "DEVTYPE"));
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN2", "DEV", "DEN2", "down", "SLOT", "DEVTYPE"));
DriveCatalogue catalogue;
ASSERT_THROW(catalogue.populateCatalogue(lines),
castor::exception::Exception);
}
TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest,
initialStateMismatchPopulate) {
using namespace castor::tape::tapeserver::daemon;
castor::tape::utils::TpconfigLines lines;
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN", "DEV", "DEN1", "down", "SLOT", "DEVTYPE"));
"UNIT1", "DGN1", "DEV", "DEN1", "SLOT", "DEVTYPE"));
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN", "DEV", "DEN2", "up", "SLOT", "DEVTYPE"));
"UNIT1", "DGN2", "DEV", "DEN2", "SLOT", "DEVTYPE"));
DriveCatalogue catalogue;
ASSERT_THROW(catalogue.populateCatalogue(lines),
......@@ -206,9 +191,9 @@ TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest,
castor::tape::utils::TpconfigLines lines;
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN", "DEV1", "DEN1", "down", "SLOT", "DEVTYPE"));
"UNIT1", "DGN", "DEV1", "DEN1", "SLOT", "DEVTYPE"));
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN", "DEV2", "DEN2", "down", "SLOT", "DEVTYPE"));
"UNIT1", "DGN", "DEV2", "DEN2", "SLOT", "DEVTYPE"));
DriveCatalogue catalogue;
ASSERT_THROW(catalogue.populateCatalogue(lines),
......@@ -221,9 +206,9 @@ TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest,
castor::tape::utils::TpconfigLines lines;
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN", "DEV", "DEN1", "down", "SLOT1", "DEVTYPE"));
"UNIT1", "DGN", "DEV", "DEN1", "SLOT1", "DEVTYPE"));
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN", "DEV", "DEN2", "down", "SLOT2", "DEVTYPE"));
"UNIT1", "DGN", "DEV", "DEN2", "SLOT2", "DEVTYPE"));
DriveCatalogue catalogue;
ASSERT_THROW(catalogue.populateCatalogue(lines),
......@@ -236,9 +221,9 @@ TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest,
castor::tape::utils::TpconfigLines lines;
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN", "DEV", "DEN1", "down", "SLOT", "DEVTYPE1"));
"UNIT1", "DGN", "DEV", "DEN1", "SLOT", "DEVTYPE1"));
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN", "DEV", "DEN2", "down", "SLOT", "DEVTYPE2"));
"UNIT1", "DGN", "DEV", "DEN2", "SLOT", "DEVTYPE2"));
DriveCatalogue catalogue;
ASSERT_THROW(catalogue.populateCatalogue(lines),
......@@ -261,7 +246,7 @@ TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest, completeFSTN) {
// Start with the tape drive in status DOWN
castor::tape::utils::TpconfigLines lines;
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT", "DGN", "DEV", "DEN", "down", "SLOT", "DEVTYPE"));
"UNIT", "DGN", "DEV", "DEN", "SLOT", "DEVTYPE"));
DriveCatalogue catalogue;
ASSERT_NO_THROW(catalogue.populateCatalogue(lines));
ASSERT_EQ(DriveCatalogue::DRIVE_STATE_DOWN, catalogue.getState("UNIT"));
......@@ -342,7 +327,7 @@ TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest, dgnMismatchStart) {
using namespace castor::tape::tapeserver::daemon;
castor::tape::utils::TpconfigLines lines;
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT", "DGN1", "DEV", "DEN", "down", "SLOT", "DEVTYPE"));
"UNIT", "DGN1", "DEV", "DEN", "SLOT", "DEVTYPE"));
DriveCatalogue catalogue;
ASSERT_NO_THROW(catalogue.populateCatalogue(lines));
......@@ -365,9 +350,9 @@ TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest, getUnitNames) {
using namespace castor::tape::tapeserver::daemon;
castor::tape::utils::TpconfigLines lines;
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT1", "DGN1", "DEV1", "DEN1", "down", "SLOT1", "DEVTYPE1"));
"UNIT1", "DGN1", "DEV1", "DEN1", "SLOT1", "DEVTYPE1"));
lines.push_back(castor::tape::utils::TpconfigLine(
"UNIT2", "DGN2", "DEV2", "DEN2", "up", "SLOT2", "DEVTYPE2"));
"UNIT2", "DGN2", "DEV2", "DEN2", "SLOT2", "DEVTYPE2"));
DriveCatalogue catalogue;
ASSERT_NO_THROW(catalogue.populateCatalogue(lines));
......@@ -386,16 +371,15 @@ TEST_F(castor_tape_tapeserver_daemon_DriveCatalogueTest, getUnitNames) {
{
std::list<std::string> downUnitNames;
ASSERT_NO_THROW(downUnitNames = catalogue.getUnitNames(DriveCatalogue::DRIVE_STATE_DOWN));
ASSERT_EQ((std::list<std::string>::size_type)1, downUnitNames.size());
ASSERT_EQ(std::string("UNIT1"), downUnitNames.front());
ASSERT_NO_THROW(downUnitNames =
catalogue.getUnitNames(DriveCatalogue::DRIVE_STATE_DOWN));
ASSERT_EQ((std::list<std::string>::size_type)2, downUnitNames.size());
}
{
std::list<std::string> upUnitNames;
ASSERT_NO_THROW(upUnitNames = catalogue.getUnitNames(DriveCatalogue::DRIVE_STATE_UP));
ASSERT_EQ((std::list<std::string>::size_type)1, upUnitNames.size());
ASSERT_EQ(std::string("UNIT2"), upUnitNames.front());
ASSERT_EQ((std::list<std::string>::size_type)0, upUnitNames.size());
}
}
......
......@@ -151,9 +151,9 @@ TEST(tapeServer, MountSessionGooddayRecall) {
utils::TpconfigLines tpConfig;
// Actual TPCONFIG lifted from prod
tpConfig.push_back(utils::TpconfigLine("T10D6116", "T10KD6",
"/dev/tape_T10D6116", "8000GC", "down", "acs0,1,1,6", "T10000"));
"/dev/tape_T10D6116", "8000GC", "acs0,1,1,6", "T10000"));
tpConfig.push_back(utils::TpconfigLine("T10D6116", "T10KD6",
"/dev/tape_T10D6116", "5000GC", "down", "acs0,1,1,6", "T10000"));
"/dev/tape_T10D6116", "5000GC", "acs0,1,1,6", "T10000"));
MountSession::CastorConf castorConf;
castorConf.rtcopydBufsz = 1024*1024; // 1 MB memory buffers
castorConf.rtcopydNbBufs = 10;
......@@ -217,9 +217,9 @@ TEST(tapeServer, MountSessionNoSuchDrive) {
utils::TpconfigLines tpConfig;
// Actual TPCONFIG lifted from prod
tpConfig.push_back(utils::TpconfigLine("T10D6116", "T10KD6",
"/dev/noSuchTape", "8000GC", "down", "acs0,1,1,6", "T10000"));
"/dev/noSuchTape", "8000GC", "acs0,1,1,6", "T10000"));
tpConfig.push_back(utils::TpconfigLine("T10D6116", "T10KD6",
"/dev/noSuchTape", "5000GC", "down", "acs0,1,1,6", "T10000"));
"/dev/noSuchTape", "5000GC", "acs0,1,1,6", "T10000"));
MountSession::CastorConf castorConf;
castorConf.rtcopydBufsz = 1024;
castorConf.rtcopydNbBufs = 10;
......@@ -367,9 +367,9 @@ TEST(tapeServer, MountSessionGooddayMigration) {
utils::TpconfigLines tpConfig;
// Actual TPCONFIG lifted from prod
tpConfig.push_back(utils::TpconfigLine("T10D6116", "T10KD6",
"/dev/tape_T10D6116", "8000GC", "down", "acs0,1,1,6", "T10000"));
"/dev/tape_T10D6116", "8000GC", "acs0,1,1,6", "T10000"));
tpConfig.push_back(utils::TpconfigLine("T10D6116", "T10KD6",
"/dev/tape_T10D6116", "5000GC", "down", "acs0,1,1,6", "T10000"));
"/dev/tape_T10D6116", "5000GC", "acs0,1,1,6", "T10000"));
MountSession::CastorConf castorConf;
castorConf.rtcopydBufsz = 1024*1024; // 1 MB memory buffers
castorConf.rtcopydNbBufs = 10;
......
......@@ -77,7 +77,7 @@ TEST(castor_tape_tapeserver_daemon, RecallTaskInjectorNominal) {
volume.vid="V12345";
volume.volumeMode=castor::tape::tapegateway::READ;
castor::tape::tapeserver::daemon::GlobalStatusReporter gsr(initialProcess,
utils::TpconfigLine("","","","","UP","",""),"0.0.0.0",volume,lc);
utils::TpconfigLine("","","","","",""),"0.0.0.0",volume,lc);
castor::tape::tapeserver::daemon::CapabilityUtilsDummy cap;
FakeSingleTapeReadThread tapeRead(drive, rmc, gsr, volume, cap,lc);
......@@ -135,7 +135,7 @@ TEST(castor_tape_tapeserver_daemon, RecallTaskInjectorNoFiles) {
volume.volumeMode=castor::tape::tapegateway::READ;
castor::tape::tapeserver::daemon::CapabilityUtilsDummy cap;
castor::tape::tapeserver::daemon::GlobalStatusReporter gsr(initialProcess,
utils::TpconfigLine("","","","","UP","",""),"0.0.0.0",volume,lc);
utils::TpconfigLine("","","","","",""),"0.0.0.0",volume,lc);
FakeSingleTapeReadThread tapeRead(drive, rmc, gsr, volume,cap, lc);
tapeserver::daemon::RecallReportPacker rrp(client,2,lc);
......
......@@ -250,7 +250,6 @@ void castor::tape::tapeserver::daemon::TapeDaemon::logTpconfigLine(
log::Param("dgn", line.dgn),
log::Param("devFilename", line.devFilename),
log::Param("density", line.density),
log::Param("initialState", line.initialState),
log::Param("librarySlot", line.librarySlot),
log::Param("devType", line.devType)};
m_log(LOG_INFO, "TPCONFIG line", params);
......
......@@ -34,46 +34,12 @@ castor::tape::utils::TpconfigLine::TpconfigLine(
const std::string &dgn,
const std::string &devFilename,
const std::string &density,
const std::string &initialState,
const std::string &librarySlot,
const std::string &devType) throw():
unitName(unitName),
dgn(dgn),
devFilename(devFilename),
density(density),
initialState(str2InitialState(initialState)),
librarySlot(librarySlot),
devType(devType) {
}
//------------------------------------------------------------------------------
// initialState2Str
//------------------------------------------------------------------------------
const char *castor::tape::utils::TpconfigLine::initialState2Str(
const InitialState value) throw() {
switch(value) {
case TPCONFIG_DRIVE_NONE: return "none";
case TPCONFIG_DRIVE_UP: return "up";
case TPCONFIG_DRIVE_DOWN: return "down";
default: return "unknown";
}
}
//------------------------------------------------------------------------------
// str2InitialState
//------------------------------------------------------------------------------
castor::tape::utils::TpconfigLine::InitialState
castor::tape::utils::TpconfigLine::str2InitialState(std::string str) {
castor::utils::toUpper(str);
if(str == "UP") {
return TPCONFIG_DRIVE_UP;
} else if(str == "DOWN") {
return TPCONFIG_DRIVE_DOWN;
} else {
castor::exception::Exception ex;
ex.getMessage() <<
"Failed to interpret string representation of initial tape-drive state"
": str=" << str;
throw ex;
}
}
......@@ -36,46 +36,10 @@ namespace utils {
* TPCONFIG file (/etc/castor/TPCONFIG).
*/
struct TpconfigLine {
/**
* Enumeration of the possible initial states of a tape drive.
*/
enum InitialState {
TPCONFIG_DRIVE_NONE,
TPCONFIG_DRIVE_UP,
TPCONFIG_DRIVE_DOWN};
/**
* Returns the string representation of the specified initial state of a
* tape drive.
*
* This method is thread safe.
*
* This method does not throw an exception. If the specified state is
* unknown then an appropriately worded string is returned.
*
* @param state The initial state of a tape drive.
* @return The string representation.
*/
static const char *initialState2Str(const InitialState value) throw();
/**
* Returns the initial tape-drive state represented by the specified string.
*
* This method throws an exception if the specified string representation is
* unknown.
*
* This method will not interpret a string a representing TPCONFIG_DRIVE_NONE.
*
* @param str The string representation of the initial tape-drive state.
* @return The initial state of the tape drive.
*/
static InitialState str2InitialState(std::string str);
std::string unitName;
std::string dgn;
std::string devFilename;
std::string density;
InitialState initialState;
std::string librarySlot;
std::string devType;
......@@ -87,7 +51,6 @@ struct TpconfigLine {
const std::string &dgn,
const std::string &devFilename,
const std::string &density,
const std::string &initialState,
const std::string &librarySlot,
const std::string &devType) throw();
}; // struct TpconfigLine
......
......@@ -40,65 +40,4 @@ protected:
}
};
TEST_F( castor_tape_utils_TpconfigLineTest, convertDownLowerCase) {
using namespace castor::tape::utils;
TpconfigLine::InitialState state = TpconfigLine::TPCONFIG_DRIVE_NONE;
ASSERT_NO_THROW(state = TpconfigLine::str2InitialState("down"));
ASSERT_EQ(TpconfigLine::TPCONFIG_DRIVE_DOWN, state);
}
TEST_F( castor_tape_utils_TpconfigLineTest, convertDownUpperCase) {
using namespace castor::tape::utils;
TpconfigLine::InitialState state = TpconfigLine::TPCONFIG_DRIVE_NONE;
ASSERT_NO_THROW(state = TpconfigLine::str2InitialState("DOWN"));
ASSERT_EQ(TpconfigLine::TPCONFIG_DRIVE_DOWN, state);
}
TEST_F( castor_tape_utils_TpconfigLineTest, convertDownMixedCase) {
using namespace castor::tape::utils;
TpconfigLine::InitialState state = TpconfigLine::TPCONFIG_DRIVE_NONE;
ASSERT_NO_THROW(state = TpconfigLine::str2InitialState("Down"));
ASSERT_EQ(TpconfigLine::TPCONFIG_DRIVE_DOWN, state);
}
TEST_F( castor_tape_utils_TpconfigLineTest, convertUpLowerCase) {
using namespace castor::tape::utils;
TpconfigLine::InitialState state = TpconfigLine::TPCONFIG_DRIVE_NONE;
ASSERT_NO_THROW(state = TpconfigLine::str2InitialState("up"));
ASSERT_EQ(TpconfigLine::TPCONFIG_DRIVE_UP, state);
}
TEST_F( castor_tape_utils_TpconfigLineTest, convertUpUpperCase) {
using namespace castor::tape::utils;
TpconfigLine::InitialState state = TpconfigLine::TPCONFIG_DRIVE_NONE;
ASSERT_NO_THROW(state = TpconfigLine::str2InitialState("UP"));
ASSERT_EQ(TpconfigLine::TPCONFIG_DRIVE_UP, state);
}
TEST_F( castor_tape_utils_TpconfigLineTest, convertUpMixedCase) {
using namespace castor::tape::utils;
TpconfigLine::InitialState state = TpconfigLine::TPCONFIG_DRIVE_NONE;
ASSERT_NO_THROW(state = TpconfigLine::str2InitialState("Up"));
ASSERT_EQ(TpconfigLine::TPCONFIG_DRIVE_UP, state);
}
TEST_F( castor_tape_utils_TpconfigLineTest, convertNonsense) {
using namespace castor::tape::utils;
ASSERT_THROW(TpconfigLine::str2InitialState("Nonsense"),
castor::exception::Exception);
}
} // namespace unitTests
......@@ -470,7 +470,7 @@ void castor::tape::utils::parseTpconfigFile(const char *const filename,
TpconfigLines &lines) {
// The expected number of data-columns in a TPCONFIG data-line
const unsigned int NBCOLUMNS = 7;
const unsigned int expectedNbOfColumns = 6;
// Open the TPCONFIG file for reading
castor::utils::SmartFILEPtr file(fopen(filename, "r"));
......@@ -534,14 +534,14 @@ void castor::tape::utils::parseTpconfigFile(const char *const filename,
castor::utils::splitString(line, ' ', columns);
// Throw an exception if the number of data-columns is invalid
if(columns.size() != NBCOLUMNS) {
if(columns.size() != expectedNbOfColumns) {
castor::exception::InvalidArgument ex;
ex.getMessage() <<
"Failed to parse TPCONFIG file"
": Invalid number of data columns in TPCONFIG line"
": filename='" << filename << "'"
": expectedNbColumns=" << NBCOLUMNS <<
": expectedNbColumns=" << expectedNbOfColumns <<
": actualNbColumns=" << columns.size() <<
": lineNb=" << lineNb;
......@@ -554,9 +554,8 @@ void castor::tape::utils::parseTpconfigFile(const char *const filename,
columns[1], // dgn
columns[2], // devFilename
columns[3], // density
columns[4], // initialStatus
columns[5], // positionInLibrary
columns[6] // devType
columns[4], // positionInLibrary
columns[5] // devType
));
}
}
......
# example of tape configuration
#
# tape configuration, tpsrv101
# unit dev dev density initial robot/ dev
# name group name (0 = N/a) status manual type
# unit dev dev density robot/ dev
# name group name (0 = N/a) manual type
#
# units DOWN at reboot.
#
# Please replace and uncomment the following
#
#994B43A1 994BR4 /dev/nst0 200GC down acs0,3,10,1 9940
#994B43A1 994BR4 /dev/nst0 200G down acs0,3,10,1 9940
#994B43A1 994BR4 /dev/nst0 200GC manual 9940
#994B43A1 994BR4 /dev/nst0 200G manual 9940
#
#994B43A1 994BR4 /dev/nst0 60GC down acs0,3,10,1 9940
#994B43A1 994BR4 /dev/nst0 60G down acs0,3,10,1 9940
#994B43A1 994BR4 /dev/nst0 60GC manual 9940
#994B43A1 994BR4 /dev/nst0 60G manual 9940
......@@ -143,11 +143,6 @@ for LTO cartridges. If
.B 0
is specified, the tape daemon does not check the density and does not set it on the drive either.
.TP
initial status
.B up
or
.B down
.TP
robot/manual
This field may be set to
.BI acs a,l,p,d [,noro]
......@@ -204,12 +199,12 @@ Here is an example of a configuration file:
.ft CW
# Tape configuration
#
# drive dev dev density initial library dev
# name group name (0 = N/A) status slot type
# drive dev dev density library dev
# name group name (0 = N/A) slot type
#
cart0 CART /dev/nrmt0 0 down manual 3480
cart1 CART /dev/nrmt1 0 down manual 3480
exab0 8500 /dev/nrmt9 8500 down manual 8500/VB
cart0 CART /dev/nrmt0 0 manual 3480
cart1 CART /dev/nrmt1 0 manual 3480
exab0 8500 /dev/nrmt9 8500 manual 8500/VB
.ft
.fi
......
......@@ -675,14 +675,12 @@ int initdrvtab()
FILE *fopen(), *s;
unsigned int i;
int j;
char instat[5];
int lineno;
char *p_den;
char *p_dgn;
char *p_dvn;
char *p_dvt;
char *p_ldr;
char *p_stat;
char *p_unm;
char prevdrive[CA_MAXUNMLEN+1];
struct tpdev *tdp;
......@@ -715,7 +713,6 @@ int initdrvtab()
if ((p_dgn = strtok (NULL, " \t")) == NULL ||
(p_dvn = strtok (NULL, " \t")) == NULL ||
(p_den = strtok (NULL, " \t")) == NULL ||
(p_stat = strtok (NULL, " \t")) == NULL ||
(p_ldr = strtok (NULL, " \t")) == NULL ||
(p_dvt = strtok (NULL, " \t")) == NULL) {
tplogit (func, TP032, lineno, "missing fields");
......@@ -763,14 +760,6 @@ int initdrvtab()
"Message", TL_MSG_PARAM_STR, "invalid density" );
errflag++;
}
if (strcmp (p_stat, "up") && strcmp (p_stat, "down")) {
tplogit (func, TP032, lineno, "invalid status");
tl_tpdaemon.tl_log( &tl_tpdaemon, 32, 3,
"func", TL_MSG_PARAM_STR, func,
"Line", TL_MSG_PARAM_INT, lineno,
"Message", TL_MSG_PARAM_STR, "invalid status" );
errflag++;
}
if (strlen (p_ldr) > CA_MAXRBTNAMELEN) {
tplogit (func, TP032, lineno, "invalid loader");
tl_tpdaemon.tl_log( &tl_tpdaemon, 32, 3,
......@@ -833,14 +822,14 @@ int initdrvtab()
fgets (buf, sizeof(buf), s);
if (buf[0] == '#') continue; /* comment line */
if (strspn (buf, " \t") == (strlen (buf) - 1)) continue;