Commit 190a016c authored by claes's avatar claes

DetachedVolume added

parent b106f67f
/* /*
* Proview $Id: ini.c,v 1.34 2008-09-18 15:04:41 claes Exp $ * Proview $Id: ini.c,v 1.35 2008-10-16 11:10:13 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -121,7 +121,7 @@ static pwr_tBoolean loadSectRbody (pwr_tStatus*, ini_sContext*, ivol_sVolume*); ...@@ -121,7 +121,7 @@ static pwr_tBoolean loadSectRbody (pwr_tStatus*, ini_sContext*, ivol_sVolume*);
static pwr_tBoolean loadSectScObject (pwr_tStatus*, ini_sContext*, ivol_sVolume*); static pwr_tBoolean loadSectScObject (pwr_tStatus*, ini_sContext*, ivol_sVolume*);
static pwr_tBoolean loadSectVolume (pwr_tStatus*, ini_sContext*, ivol_sVolume*); static pwr_tBoolean loadSectVolume (pwr_tStatus*, ini_sContext*, ivol_sVolume*);
static pwr_tBoolean readSectFile (pwr_tStatus*, ini_sContext*, ivol_sVolume*); static pwr_tBoolean readSectFile (pwr_tStatus*, ini_sContext*, ivol_sVolume*);
static pwr_tBoolean readSectVolRef (pwr_tStatus*, ini_sContext*); static pwr_tBoolean readSectVolRef (pwr_tStatus*, ini_sContext*, ivol_sVolume*);
static pwr_tBoolean readSectVolume (pwr_tStatus*, ini_sContext*, ivol_sVolume*); static pwr_tBoolean readSectVolume (pwr_tStatus*, ini_sContext*, ivol_sVolume*);
static gdb_sObject* reloadObject (pwr_tStatus*, ini_sContext*, ivol_sVolume*, dbs_sObject*); static gdb_sObject* reloadObject (pwr_tStatus*, ini_sContext*, ivol_sVolume*, dbs_sObject*);
static pwr_tBoolean reloadSectObject (pwr_tStatus*, ini_sContext*, ivol_sVolume*); static pwr_tBoolean reloadSectObject (pwr_tStatus*, ini_sContext*, ivol_sVolume*);
...@@ -303,7 +303,7 @@ readSectFile ( ...@@ -303,7 +303,7 @@ readSectFile (
time_AtoAscii(&vp->time, time_eFormat_DateAndTime, timbuf1, sizeof(timbuf1)); time_AtoAscii(&vp->time, time_eFormat_DateAndTime, timbuf1, sizeof(timbuf1));
time_AtoAscii(&cp->dbs.file.time, time_eFormat_DateAndTime, timbuf2, sizeof(timbuf2)); time_AtoAscii(&cp->dbs.file.time, time_eFormat_DateAndTime, timbuf2, sizeof(timbuf2));
errh_LogWarning(&cp->log, "Version missmatch for volume: %s, %s != %s\n", errh_LogWarning(&cp->log, "Version missmatch for volume: %s, %s != %s",
vp->name, timbuf1, timbuf2); vp->name, timbuf1, timbuf2);
cp->warnings++; cp->warnings++;
} }
...@@ -322,7 +322,8 @@ readSectFile ( ...@@ -322,7 +322,8 @@ readSectFile (
static pwr_tBoolean static pwr_tBoolean
readSectVolRef ( readSectVolRef (
pwr_tStatus *status, pwr_tStatus *status,
ini_sContext *cp ini_sContext *cp,
ivol_sVolume *dvp
) )
{ {
dbs_sVolRef volRef; dbs_sVolRef volRef;
...@@ -362,7 +363,7 @@ readSectVolRef ( ...@@ -362,7 +363,7 @@ readSectVolRef (
lst_InsertPred(NULL, &cp->vol_lh, &vp->ll, vp); lst_InsertPred(NULL, &cp->vol_lh, &vp->ll, vp);
vp->time = volRef.time; vp->time = volRef.time;
strcpy(vp->name, volRef.name); strcpy(vp->name, volRef.name);
if (volRef.cid != pwr_eClass_ClassVolume) if ( !cdh_isClassVolumeClass( volRef.cid))
vp->isVolRef = 1; vp->isVolRef = 1;
vp->volRef = volRef; vp->volRef = volRef;
vp->oid_t = tree_CreateTable(sts, sizeof(pwr_tObjectIx), vp->oid_t = tree_CreateTable(sts, sizeof(pwr_tObjectIx),
...@@ -382,16 +383,29 @@ readSectVolRef ( ...@@ -382,16 +383,29 @@ readSectVolRef (
#endif #endif
} else if ( vp->time.tv_sec != 0) { } else if ( vp->time.tv_sec != 0) {
/* Do some checks. */ /* Do some checks. */
if (time_Acomp(&vp->time, &volRef.time) != 0) { if ( dvp->volume.cid == pwr_eClass_DetachedClassVolume) {
char timbuf1[32]; /* Check dvVersion */
char timbuf2[32]; if ( vp->volume.dvVersion != volRef.time.tv_sec) {
errh_LogWarning(&cp->log, "Version missmatch for volume %s: %s, %u (present), %d (detached)",
time_AtoAscii(&vp->time, time_eFormat_DateAndTime, timbuf1, sizeof(timbuf1)); dvp->name, vp->name, vp->volume.dvVersion, volRef.time.tv_sec);
time_AtoAscii(&volRef.time, time_eFormat_DateAndTime, timbuf2, sizeof(timbuf2)); cp->warnings++;
}
errh_LogWarning(&cp->log, "Version missmatch for volume: %s, %s != %s\n", else
vp->name, timbuf1, timbuf2); errh_LogInfo(&cp->log, "Detached volref for %s: %s, %u (present), %d (detached)",
cp->warnings++; dvp->name, vp->name, vp->volume.dvVersion, volRef.time.tv_sec);
}
else {
if (time_Acomp(&vp->time, &volRef.time) != 0) {
char timbuf1[32];
char timbuf2[32];
time_AtoAscii(&vp->time, time_eFormat_DateAndTime, timbuf1, sizeof(timbuf1));
time_AtoAscii(&volRef.time, time_eFormat_DateAndTime, timbuf2, sizeof(timbuf2));
errh_LogWarning(&cp->log, "Version missmatch for volume: %s, %s != %s",
vp->name, timbuf1, timbuf2);
cp->warnings++;
}
} }
} }
} }
...@@ -1308,7 +1322,7 @@ ini_CheckVolumeFile ( ...@@ -1308,7 +1322,7 @@ ini_CheckVolumeFile (
break; break;
case dbs_eSect_volref: case dbs_eSect_volref:
if (checkSect(sts, cp, sects, dbs_cVersionVolRef)) if (checkSect(sts, cp, sects, dbs_cVersionVolRef))
readSectVolRef(sts, cp); readSectVolRef(sts, cp, vp);
break; break;
case dbs_eSect_oid: case dbs_eSect_oid:
checkSect(sts, cp, sects, dbs_cVersionOid); checkSect(sts, cp, sects, dbs_cVersionOid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment