Define a xendevbus atttibute and add it to hypervisor. Use it for xen devices

which attach to hypervisor. This allows to use config_found_ia() instead of
config_found(), instead of relying on the order of which device are
written in ioconf.c.
From Quentin Garnier.
This commit is contained in:
bouyer 2005-08-21 22:20:28 +00:00
parent 0216bccfb3
commit d342a7617e
4 changed files with 21 additions and 19 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files.xen,v 1.28 2005/08/20 19:30:37 bouyer Exp $
# $NetBSD: files.xen,v 1.29 2005/08/21 22:20:28 bouyer Exp $
# NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp
# NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp
@ -100,6 +100,7 @@ define apmbus {}
define pnpbiosbus {}
define vesabiosbus {}
define hypervisorbus {}
define xendevbus {}
#
# System bus types
@ -110,7 +111,7 @@ attach mainbus at root
file arch/xen/i386/mainbus.c mainbus
# Xen hypervisor
device hypervisor { }: isabus, pcibus, sysmon_power
device hypervisor { }: isabus, pcibus, sysmon_power, xendevbus
attach hypervisor at hypervisorbus
file arch/xen/xen/hypervisor.c hypervisor needs-flag
@ -118,12 +119,12 @@ file arch/xen/xen/hypervisor.c hypervisor needs-flag
device npx
file arch/xen/i386/npx.c npx needs-flag
attach npx at hypervisor with npx_hv
attach npx at xendevbus with npx_hv
file arch/xen/i386/npx_hv.c npx_hv
# Xen console support
device xencons: tty
attach xencons at hypervisor
attach xencons at xendevbus
file arch/xen/xen/xencons.c xencons needs-flag
# Xen event peudo-device
@ -131,12 +132,12 @@ defpseudo xenevt
# Xen Network driver
device xennet: arp, ether, ifnet
attach xennet at hypervisor
attach xennet at xendevbus
file arch/xen/xen/if_xennet.c xennet needs-flag
# Xen Block device driver and wd/sd/cd identities
device xbd: disk
attach xbd at hypervisor
attach xbd at xendevbus
file arch/xen/xen/xbd.c xbd | wd_xen | sd_xen | cd_xen needs-flag
#attach wd at hypervisor with wd_xen

View File

@ -1,4 +1,4 @@
/* $NetBSD: hypervisor.c,v 1.15 2005/08/19 16:06:12 bouyer Exp $ */
/* $NetBSD: hypervisor.c,v 1.16 2005/08/21 22:20:28 bouyer Exp $ */
/*
* Copyright (c) 2005 Manuel Bouyer.
@ -63,7 +63,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.15 2005/08/19 16:06:12 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.16 2005/08/21 22:20:28 bouyer Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -200,7 +200,7 @@ hypervisor_attach(parent, self, aux)
#if NXENCONS > 0
hac.hac_xencons.xa_device = "xencons";
config_found(self, &hac.hac_xencons, hypervisor_print);
config_found_ia(self, "xendevbus", &hac.hac_xencons, hypervisor_print);
#endif
#if NXENNET > 0
hac.hac_xennet.xa_device = "xennet";
@ -212,7 +212,7 @@ hypervisor_attach(parent, self, aux)
#endif
#if NNPX > 0
hac.hac_xennpx.xa_device = "npx";
config_found(self, &hac.hac_xennpx, hypervisor_print);
config_found_ia(self, "xendevbus", &hac.hac_xennpx, hypervisor_print);
#endif
#if NPCI > 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_xennet.c,v 1.30 2005/08/21 13:12:59 yamt Exp $ */
/* $NetBSD: if_xennet.c,v 1.31 2005/08/21 22:20:28 bouyer Exp $ */
/*
*
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.30 2005/08/21 13:12:59 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.31 2005/08/21 22:20:28 bouyer Exp $");
#include "opt_inet.h"
#include "opt_nfs_boot.h"
@ -361,7 +361,8 @@ xennet_interface_status_change(netif_fe_interface_status_t *status)
if (sc == NULL) {
xneta.xa_device = "xennet";
xneta.xa_handle = status->handle;
config_found(netctrl.xc_parent, &xneta, netctrl.xc_cfprint);
config_found_ia(netctrl.xc_parent, "xendevbus", &xneta,
netctrl.xc_cfprint);
sc = find_device(status->handle);
if (sc == NULL) {
if (in_autoconf) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: xbd.c,v 1.21 2005/08/20 12:03:52 yamt Exp $ */
/* $NetBSD: xbd.c,v 1.22 2005/08/21 22:20:28 bouyer Exp $ */
/*
*
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xbd.c,v 1.21 2005/08/20 12:03:52 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: xbd.c,v 1.22 2005/08/21 22:20:28 bouyer Exp $");
#include "xbd.h"
#include "rnd.h"
@ -577,7 +577,7 @@ connect_interface(blkif_fe_interface_status_t *status)
xbda = get_xbda(xd);
if (xbda) {
xbda->xa_xd = xd;
config_found(blkctrl.xc_parent, xbda,
config_found_ia(blkctrl.xc_parent, "xendevbus", xbda,
blkctrl.xc_cfprint);
}
}
@ -664,8 +664,8 @@ vbd_update(void)
xbda = get_xbda(xd);
if (xbda) {
xbda->xa_xd = xd;
config_found(blkctrl.xc_parent, xbda,
blkctrl.xc_cfprint);
config_found_ia(blkctrl.xc_parent, "xendevbus",
xbda, blkctrl.xc_cfprint);
}
j++;
} else {
@ -696,7 +696,7 @@ vbd_update(void)
xbda = get_xbda(xd);
if (xbda) {
xbda->xa_xd = xd;
config_found(blkctrl.xc_parent, xbda,
config_found_ia(blkctrl.xc_parent, "xendevbus", xbda,
blkctrl.xc_cfprint);
}
}