Check for both kinds of Vinum module (with and without RAID-5). Using
the wrong module can cause confusion, including loading both versions (which conflict with each other) and incorrect ioctls, which cause unintelligible error messages. Extend 'start' command: if used without any parameters, vinum scans all disks known to devstat for vinum drives and reads their configuration.
This commit is contained in:
parent
77a14d66b8
commit
730ed31899
@ -117,12 +117,19 @@ int tokens; /* number of tokens */
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
#if __FreeBSD__ >= 3
|
||||
#if RAID5
|
||||
#define VINUMMOD "Vinum"
|
||||
#define WRONGMOD "vinum" /* don't want this one */
|
||||
#else
|
||||
#define VINUMMOD "vinum"
|
||||
#define WRONGMOD "Vinum" /* don't want this one */
|
||||
#endif
|
||||
|
||||
if (modfind(WRONGMOD) >= 0) { /* wrong module loaded, */
|
||||
fprintf(stderr, "Wrong module loaded: %s. Please start %s.\n", WRONGMOD, WRONGMOD);
|
||||
exit(1);
|
||||
}
|
||||
if (modfind(VINUMMOD) < 0) {
|
||||
/* need to load the vinum module */
|
||||
if (kldload(VINUMMOD) < 0 || modfind(VINUMMOD) < 0) {
|
||||
@ -130,6 +137,7 @@ main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
superdev = open(VINUM_SUPERDEV_NAME, O_RDWR); /* open it */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user