direct-io.hg

changeset 1275:a15ca0468c7b

bitkeeper revision 1.839 (406ee643kSLveMGyvVob0usRgg-CGg)

vif.h, Makefile, domain.c, setup.c, entry.S, Rules.mk:
Completely remove networking support from Xen when 'nodev=y' is specified.
author kaf24@scramble.cl.cam.ac.uk
date Sat Apr 03 16:28:51 2004 +0000 (2004-04-03)
parents 20a5f571fb14
children 4ed5e97d4286
files xen/Makefile xen/Rules.mk xen/arch/i386/entry.S xen/arch/i386/setup.c xen/common/Makefile xen/common/domain.c xen/drivers/Makefile xen/include/xen/vif.h
line diff
     1.1 --- a/xen/Makefile	Sat Apr 03 16:03:11 2004 +0000
     1.2 +++ b/xen/Makefile	Sat Apr 03 16:28:51 2004 +0000
     1.3 @@ -36,7 +36,9 @@ clean: delete-links
     1.4  $(TARGET): delete-unfresh-files make-links $(GENERATED_FILES)
     1.5  	$(MAKE) -C tools
     1.6  	$(MAKE) -C common
     1.7 -	$(MAKE) -C net
     1.8 +	if [ "$(nodev)" != "y" ]; then \
     1.9 +	$(MAKE) -C net ; \
    1.10 +	fi
    1.11  	$(MAKE) -C drivers
    1.12  	$(MAKE) -C arch/$(TARGET_ARCH)
    1.13  
     2.1 --- a/xen/Rules.mk	Sat Apr 03 16:03:11 2004 +0000
     2.2 +++ b/xen/Rules.mk	Sat Apr 03 16:28:51 2004 +0000
     2.3 @@ -18,11 +18,11 @@ OBJS    += $(patsubst %.c,%.o,$(C_SRCS))
     2.4  
     2.5  # Note that link order matters!
     2.6  ALL_OBJS := $(BASEDIR)/common/common.o
     2.7 -ALL_OBJS += $(BASEDIR)/net/network.o
     2.8  ALL_OBJS += $(BASEDIR)/drivers/char/driver.o
     2.9  ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o
    2.10 +ifneq ($(nodev),y)
    2.11 +ALL_OBJS += $(BASEDIR)/net/network.o
    2.12  ALL_OBJS += $(BASEDIR)/drivers/net/driver.o
    2.13 -ifneq ($(nodev),y)
    2.14  ALL_OBJS += $(BASEDIR)/drivers/block/driver.o
    2.15  ALL_OBJS += $(BASEDIR)/drivers/cdrom/driver.o
    2.16  ALL_OBJS += $(BASEDIR)/drivers/ide/driver.o
    2.17 @@ -46,7 +46,6 @@ endif
    2.18  
    2.19  ifeq ($(nodev),y)
    2.20  CFLAGS += -DNO_DEVICES_IN_XEN
    2.21 -CFLAGS := $(subst -Werror,,$(CFLAGS))
    2.22  endif
    2.23  
    2.24  %.o: %.c $(HDRS) Makefile
     3.1 --- a/xen/arch/i386/entry.S	Sat Apr 03 16:03:11 2004 +0000
     3.2 +++ b/xen/arch/i386/entry.S	Sat Apr 03 16:28:51 2004 +0000
     3.3 @@ -706,14 +706,19 @@ ENTRY(hypervisor_call_table)
     3.4          .long SYMBOL_NAME(do_set_gdt)
     3.5          .long SYMBOL_NAME(do_stack_switch)
     3.6          .long SYMBOL_NAME(do_set_callbacks)      /*  5 */
     3.7 +#ifndef NO_DEVICES_IN_XEN
     3.8          .long SYMBOL_NAME(do_net_io_op)
     3.9 +#else
    3.10 +        .long SYMBOL_NAME(do_ni_syscall)
    3.11 +#endif
    3.12          .long SYMBOL_NAME(do_fpu_taskswitch)
    3.13          .long SYMBOL_NAME(do_sched_op)
    3.14          .long SYMBOL_NAME(do_dom0_op)
    3.15 +#ifndef NO_DEVICES_IN_XEN
    3.16          .long SYMBOL_NAME(do_network_op)         /* 10 */
    3.17 -#ifndef NO_DEVICES_IN_XEN
    3.18          .long SYMBOL_NAME(do_block_io_op)
    3.19  #else
    3.20 +        .long SYMBOL_NAME(do_ni_syscall)         /* 10 */
    3.21          .long SYMBOL_NAME(do_ni_syscall)
    3.22  #endif
    3.23          .long SYMBOL_NAME(do_set_debugreg)
     4.1 --- a/xen/arch/i386/setup.c	Sat Apr 03 16:03:11 2004 +0000
     4.2 +++ b/xen/arch/i386/setup.c	Sat Apr 03 16:28:51 2004 +0000
     4.3 @@ -317,9 +317,11 @@ void __init start_of_day(void)
     4.4      extern void timer_bh(void);
     4.5      extern void init_timervecs(void);
     4.6      extern void ac_timer_init(void);
     4.7 +#ifndef NO_DEVICES_IN_XEN
     4.8      extern int  setup_network_devices(void);
     4.9      extern void net_init(void);
    4.10      extern void initialize_block_io(void);
    4.11 +#endif
    4.12      extern void initialize_keytable(); 
    4.13      extern void initialize_keyboard(void);
    4.14      extern int opt_nosmp, opt_watchdog, opt_noacpi, opt_ignorebiostables;
    4.15 @@ -415,10 +417,10 @@ void __init start_of_day(void)
    4.16      pci_init();
    4.17  #endif
    4.18      do_initcalls();
    4.19 +#ifndef NO_DEVICES_IN_XEN
    4.20      if ( !setup_network_devices() )
    4.21          panic("Must have a network device!\n");
    4.22      net_init();            /* initializes virtual network system. */
    4.23 -#ifndef NO_DEVICES_IN_XEN
    4.24      initialize_block_io(); /* setup block devices */
    4.25  #endif
    4.26  
     5.1 --- a/xen/common/Makefile	Sat Apr 03 16:03:11 2004 +0000
     5.2 +++ b/xen/common/Makefile	Sat Apr 03 16:28:51 2004 +0000
     5.3 @@ -5,6 +5,10 @@ ifeq ($(nperfc),y)
     5.4  OBJS := $(subst perfc.o,,$(OBJS))
     5.5  endif
     5.6  
     5.7 +ifeq ($(nodev),y)
     5.8 +OBJS := $(subst network.o,,$(OBJS))
     5.9 +endif
    5.10 +
    5.11  default: $(OBJS)
    5.12  	$(LD) $(LDARCHFLAGS) -r -o common.o $(OBJS)
    5.13  
     6.1 --- a/xen/common/domain.c	Sat Apr 03 16:03:11 2004 +0000
     6.2 +++ b/xen/common/domain.c	Sat Apr 03 16:28:51 2004 +0000
     6.3 @@ -695,7 +695,6 @@ int construct_dom0(struct task_struct *p
     6.4  {
     6.5      char *dst;
     6.6      int i, rc;
     6.7 -    domid_t dom = p->domain;
     6.8      unsigned long pfn, mfn;
     6.9      unsigned long nr_pages = (alloc_end - alloc_start) >> PAGE_SHIFT;
    6.10      unsigned long nr_pt_pages;
    6.11 @@ -730,11 +729,14 @@ int construct_dom0(struct task_struct *p
    6.12      unsigned long mpt_alloc;
    6.13  
    6.14      extern void physdev_init_dom0(struct task_struct *);
    6.15 +
    6.16 +#ifndef NO_DEVICES_IN_XEN
    6.17      extern void ide_probe_devices(xen_disk_info_t *);
    6.18      extern void scsi_probe_devices(xen_disk_info_t *);
    6.19      extern void cciss_probe_devices(xen_disk_info_t *);
    6.20      xen_disk_info_t xdi;
    6.21      xen_disk_t *xd;
    6.22 +#endif
    6.23  
    6.24      /* Sanity! */
    6.25      if ( p->domain != 0 ) 
    6.26 @@ -989,7 +991,7 @@ int construct_dom0(struct task_struct *p
    6.27  
    6.28      /* Add virtual network interfaces. */
    6.29      while ( num_vifs-- > 0 )
    6.30 -        (void)create_net_vif(dom);
    6.31 +        (void)create_net_vif(0);
    6.32  
    6.33  #ifndef NO_DEVICES_IN_XEN
    6.34      /* DOM0 gets access to all real block devices. */
     7.1 --- a/xen/drivers/Makefile	Sat Apr 03 16:03:11 2004 +0000
     7.2 +++ b/xen/drivers/Makefile	Sat Apr 03 16:28:51 2004 +0000
     7.3 @@ -2,8 +2,8 @@
     7.4  default:
     7.5  	$(MAKE) -C char
     7.6  	$(MAKE) -C pci
     7.7 -	$(MAKE) -C net
     7.8  	if [ "$(nodev)" != "y" ]; then \
     7.9 +	$(MAKE) -C net ; \
    7.10  	$(MAKE) -C block ; \
    7.11  	$(MAKE) -C cdrom ; \
    7.12  	$(MAKE) -C ide ; \
     8.1 --- a/xen/include/xen/vif.h	Sat Apr 03 16:03:11 2004 +0000
     8.2 +++ b/xen/include/xen/vif.h	Sat Apr 03 16:28:51 2004 +0000
     8.3 @@ -95,12 +95,19 @@ do {                                    
     8.4  } while (0)                                                        \
     8.5  
     8.6  /* vif prototypes */
     8.7 +#ifndef NO_DEVICES_IN_XEN
     8.8  net_vif_t *create_net_vif(domid_t dom);
     8.9  void destroy_net_vif(net_vif_t *vif);
    8.10  void unlink_net_vif(net_vif_t *vif);
    8.11  net_vif_t *net_get_target_vif(u8 *data, unsigned int len, net_vif_t *src_vif);
    8.12  net_vif_t *find_net_vif(domid_t dom, unsigned int idx);
    8.13  void delete_all_domain_vfr_rules(struct task_struct *p);
    8.14 +#else
    8.15 +#define create_net_vif(_d) ((void)0)
    8.16 +#define destroy_net_vif(_v) ((void)0)
    8.17 +#define unlink_net_vif(_v) ((void)0)
    8.18 +#define delete_all_domain_vfr_rules(_p) ((void)0)
    8.19 +#endif
    8.20  
    8.21  /*
    8.22   * Return values from net_get_target_vif: