From d342a7617ef348bba76a33f954d47ee31c5f6d97 Mon Sep 17 00:00:00 2001 From: bouyer Date: Sun, 21 Aug 2005 22:20:28 +0000 Subject: [PATCH] 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. --- sys/arch/xen/conf/files.xen | 13 +++++++------ sys/arch/xen/xen/hypervisor.c | 8 ++++---- sys/arch/xen/xen/if_xennet.c | 7 ++++--- sys/arch/xen/xen/xbd.c | 12 ++++++------ 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/sys/arch/xen/conf/files.xen b/sys/arch/xen/conf/files.xen index 9c521b9c3d13..01cf2fd8f3bf 100644 --- a/sys/arch/xen/conf/files.xen +++ b/sys/arch/xen/conf/files.xen @@ -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 diff --git a/sys/arch/xen/xen/hypervisor.c b/sys/arch/xen/xen/hypervisor.c index 99de0bc4d7c6..46e3ba69685d 100644 --- a/sys/arch/xen/xen/hypervisor.c +++ b/sys/arch/xen/xen/hypervisor.c @@ -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 -__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 #include @@ -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 diff --git a/sys/arch/xen/xen/if_xennet.c b/sys/arch/xen/xen/if_xennet.c index 13418e64eaeb..645124be796c 100644 --- a/sys/arch/xen/xen/if_xennet.c +++ b/sys/arch/xen/xen/if_xennet.c @@ -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 -__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) { diff --git a/sys/arch/xen/xen/xbd.c b/sys/arch/xen/xen/xbd.c index 3e2ae5a15ff2..b077a1f77d78 100644 --- a/sys/arch/xen/xen/xbd.c +++ b/sys/arch/xen/xen/xbd.c @@ -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 -__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); } }