summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2010-11-03 10:15:24 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2010-11-03 10:15:24 +0000
commite7058aa66e3a181d2a27cb673c40ebab345ac2f9 (patch)
tree3befe9a5e7f5bbaa29abcda4046ef1cebb3a5aeb
parent8015784c5dccf3a6d8b98a0efe00a333321d59c6 (diff)
only let vmt match and therefore attach if mainbus is specifically asking
for vmt to attach after vmt_probe succeeds. this prevents vmt from appearing at other attach points hanging off mainbus. found by phessler@ and debugged gently by claudio@
-rw-r--r--sys/arch/amd64/amd64/mainbus.c4
-rw-r--r--sys/arch/i386/i386/mainbus.c4
-rw-r--r--sys/dev/vmt.c7
3 files changed, 8 insertions, 7 deletions
diff --git a/sys/arch/amd64/amd64/mainbus.c b/sys/arch/amd64/amd64/mainbus.c
index d304f540615..a5b1b1c5cdd 100644
--- a/sys/arch/amd64/amd64/mainbus.c
+++ b/sys/arch/amd64/amd64/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.22 2009/12/28 14:22:09 dlg Exp $ */
+/* $OpenBSD: mainbus.c,v 1.23 2010/11/03 10:15:22 dlg Exp $ */
/* $NetBSD: mainbus.c,v 1.1 2003/04/26 18:39:29 fvdl Exp $ */
/*
@@ -174,7 +174,7 @@ mainbus_attach(struct device *parent, struct device *self, void *aux)
#if NVMT > 0
if (vmt_probe()) {
- mba.mba_busname = "vmware";
+ mba.mba_busname = "vmt";
config_found(self, &mba.mba_busname, mainbus_print);
}
#endif
diff --git a/sys/arch/i386/i386/mainbus.c b/sys/arch/i386/i386/mainbus.c
index 3372339a90c..d9db1b6c819 100644
--- a/sys/arch/i386/i386/mainbus.c
+++ b/sys/arch/i386/i386/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.47 2009/11/23 22:57:38 deraadt Exp $ */
+/* $OpenBSD: mainbus.c,v 1.48 2010/11/03 10:15:23 dlg Exp $ */
/* $NetBSD: mainbus.c,v 1.21 1997/06/06 23:14:20 thorpej Exp $ */
/*
@@ -166,7 +166,7 @@ mainbus_attach(struct device *parent, struct device *self, void *aux)
#if NVMT > 0
if (vmt_probe()) {
- mba.mba_busname = "vmware";
+ mba.mba_busname = "vmt";
config_found(self, &mba.mba_busname, mainbus_print);
}
#endif
diff --git a/sys/dev/vmt.c b/sys/dev/vmt.c
index a19d16c6c35..23e3c2890fb 100644
--- a/sys/dev/vmt.c
+++ b/sys/dev/vmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmt.c,v 1.9 2010/10/26 01:16:11 dlg Exp $ */
+/* $OpenBSD: vmt.c,v 1.10 2010/11/03 10:15:23 dlg Exp $ */
/*
* Copyright (c) 2007 David Crawshaw <david@zentus.com>
@@ -245,8 +245,9 @@ vmt_probe(void)
int
vmt_match(struct device *parent, void *match, void *aux)
{
- /* we cant get here unless vmt_probe previously succeeded */
- return (1);
+ const char **busname = (const char **)aux;
+
+ return (strcmp(*busname, vmt_cd.cd_name) == 0);
}
void