summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2013-08-26 01:59:22 +0000
committerdlg <dlg@openbsd.org>2013-08-26 01:59:22 +0000
commit5cbbdea20de7dd041de90274308efc3ff1892349 (patch)
tree0b2a675a695614352bd31e34689d9fbe4fd224e3
parentmake scsi_{xsh,ioh}_{add,del} return whether they moved something (diff)
downloadwireguard-openbsd-5cbbdea20de7dd041de90274308efc3ff1892349.tar.xz
wireguard-openbsd-5cbbdea20de7dd041de90274308efc3ff1892349.zip
move attach mpath before any hardware. the benefits being:
- the mpath hooks path drivers call dont have to parse autoconf structures to tell if mpath may attach in the future. it now either has already attached or never will, which is simpler to check. - i can get rid of the global mpath target array by moving it into the mpath softc because of the above. - makes reasoning about state transitions (especially around when to attach) when groups of paths are implemented a lot simpler the only real caveat is dmesg feng shui may be ruined. i can come back and look at this after i move mpath itself forward though. discussed with deraadt@ miod@ ok todd@ matthew@ krw@
-rw-r--r--sys/kern/init_main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index a7b4c43c512..b90b4c8a844 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.189 2013/06/03 16:55:22 guenther Exp $ */
+/* $OpenBSD: init_main.c,v 1.190 2013/08/26 01:59:22 dlg Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -346,6 +346,11 @@ main(void *framep)
/* Initialize the interface/address trees */
ifinit();
+#if NMPATH > 0
+ /* Attach mpath before hardware */
+ config_rootfound("mpath", NULL);
+#endif
+
/* Configure the devices */
cpu_configure();
@@ -456,9 +461,6 @@ main(void *framep)
dostartuphooks();
-#if NMPATH > 0
- config_rootfound("mpath", NULL);
-#endif
#if NVSCSI > 0
config_rootfound("vscsi", NULL);
#endif