ia64/xen-unstable

changeset 10758:89f7faa0c01a

Xm-test HVM network testing is broken. The new qemu code doesn't support
pcnet32, which is the current default driver loaded onto the disk.img.
This patch changes teh default to the rtl8139, which is xend's default.
This patch also adds a new "--with-network-drv" configuration option so
people can configure different drivers than the default.

Signed-off-by: Daniel Stekloff <dsteklof@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Jul 14 11:54:10 2006 +0100 (2006-07-14)
parents 612671bd9a54
children 9b6c901b9de5
files tools/xm-test/configure.ac tools/xm-test/ramdisk/Makefile.am tools/xm-test/ramdisk/bin/create_disk_image
line diff
     1.1 --- a/tools/xm-test/configure.ac	Fri Jul 14 11:48:48 2006 +0100
     1.2 +++ b/tools/xm-test/configure.ac	Fri Jul 14 11:54:10 2006 +0100
     1.3 @@ -84,6 +84,14 @@ AC_ARG_WITH(driver-dir,
     1.4  dnl substitute @DRVDIR@ in all Makefiles
     1.5  AC_SUBST(DRVDIR)
     1.6  
     1.7 +NETDRV="8139too.ko"
     1.8 +AC_ARG_WITH(network-drv,
     1.9 +	[  --with-network-drv=driver Set network driver to use [[default="8139too.ko"]]],
    1.10 +	[ NETDRV="$withval" ])
    1.11 +
    1.12 +dnl substitute @DRVDIR@ in all Makefiles
    1.13 +AC_SUBST(NETDRV)
    1.14 +
    1.15  AC_SUBST(TENV)
    1.16  AC_SUBST(PACKAGE_VERSION)
    1.17  
     2.1 --- a/tools/xm-test/ramdisk/Makefile.am	Fri Jul 14 11:48:48 2006 +0100
     2.2 +++ b/tools/xm-test/ramdisk/Makefile.am	Fri Jul 14 11:54:10 2006 +0100
     2.3 @@ -51,13 +51,14 @@ disk.img: existing
     2.4  	chmod a+x $(HVM_SCRIPT)
     2.5  	@if test ! "$(HVMKERNEL)" = "no" -a ! "$(DRVDIR)" = "no"; then \
     2.6  		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
     2.7 -			-d $(DRVDIR); \
     2.8 +			-d $(DRVDIR) -n $(NETDRV); \
     2.9  	elif test "$(HVMKERNEL)" = "no" -a ! "$(DRVDIR)" = "no"; then \
    2.10 -		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -d $(DRVDIR); \
    2.11 +		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -d $(DRVDIR) -n $(NETDRV); \
    2.12  	elif test ! "$(HVMKERNEL)" = "no" -a "$(DRVDIR)" = "no"; then \
    2.13 -		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL); \
    2.14 +		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
    2.15 +			-n $(NETDRV); \
    2.16  	else \
    2.17 -		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG); \
    2.18 +		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -n $(NETDRV); \
    2.19  	fi
    2.20  
    2.21  existing:
     3.1 --- a/tools/xm-test/ramdisk/bin/create_disk_image	Fri Jul 14 11:48:48 2006 +0100
     3.2 +++ b/tools/xm-test/ramdisk/bin/create_disk_image	Fri Jul 14 11:54:10 2006 +0100
     3.3 @@ -51,20 +51,21 @@ Command creates a hvm guest disk image f
     3.4  Usage: $0 [OPTIONS]
     3.5  
     3.6  OPTIONS:
     3.7 -    -d|--dvrdir <name>       Directory where to fine network driver 
     3.8 +    -d|--dvrdir <name>       Directory where to find network driver 
     3.9                               to use for disk image. 
    3.10      -i|--image <name>        Image name to create.
    3.11      -k|--kernel <name>       Kernel name to use for disk image.
    3.12 +    -n|--netdrv <name>       Network driver name to use for disk image.
    3.13      -r|--rootfs <image>      Rootfs image to use for disk image.
    3.14  
    3.15 -This script currently only supports the pcnet32 driver for network
    3.16 -tests. If a dvrdir isn't added on the command-line, it will look
    3.17 -in /lib/modules/ directory relating to the supplied kernel. If the
    3.18 +This script defaults to using the 8139too.ko driver for network tests. 
    3.19 +If a dvrdir isn't added on the command-line, it will look in 
    3.20 +/lib/modules/ directory relating to the supplied kernel. If the
    3.21  network driver is built into the kernel, you can specify the key word
    3.22  "builtin" with the -d option and the script will continue.
    3.23  
    3.24 -Note: The pcnet32 driver relies upon mii.ko. This script will look
    3.25 -for that module in the same location as the pcnet32 driver, either
    3.26 +Note: Many network drivers rely upon mii.ko. This script will look
    3.27 +for that module in the same location as the network driver, either
    3.28  for the kernel or the location used with the -d option.
    3.29  
    3.30  EOU
    3.31 @@ -94,6 +95,7 @@ function initialize_globals()
    3.32  	IMAGE="disk.img"
    3.33  	KERNEL=""
    3.34  	DRVDIR=""
    3.35 +	NETDRV="8139too.ko"
    3.36  	LCONF="lilo.conf"
    3.37  	LOOPD=""    # Loop device for entire disk image
    3.38  	LOOPP=""    # Loop device for ext partition
    3.39 @@ -126,6 +128,11 @@ function get_options()
    3.40  				KERNEL=${1}
    3.41  				shift
    3.42  				;;
    3.43 +			-n|--netdrv)
    3.44 +				shift
    3.45 +				NETDRV=${1}
    3.46 +				shift
    3.47 +				;;
    3.48  			-r|--rootfs)
    3.49  				shift
    3.50  				ROOTFS=${1}
    3.51 @@ -256,23 +263,23 @@ function copy_netdriver_to_image()
    3.52                                                                                  
    3.53  	mkdir "$MNT/lib/modules"
    3.54  	if [ -e "$DRVDIR" ]; then
    3.55 -		if [ -e "$DRVDIR/pcnet32.ko" ]; then
    3.56 +		if [ -e "$DRVDIR/$NETDRV" ]; then
    3.57  			cp $DRVDIR/mii.ko $MNT/lib/modules
    3.58 -			cp $DRVDIR/pcnet32.ko $MNT/lib/modules
    3.59 +			cp $DRVDIR/$NETDRV $MNT/lib/modules
    3.60  		else
    3.61 -			die "Failed to find pcnet32.ko at $DRVDIR."
    3.62 +			die "Failed to find $NETDRV at $DRVDIR."
    3.63  		fi
    3.64 -	elif [ -e "$fdir/pcnet32.ko" ]; then
    3.65 +	elif [ -e "$fdir/$NETDRV" ]; then
    3.66  		cp $fdir/mii.ko $MNT/lib/modules
    3.67 -		cp $fdir/pcnet32.ko $MNT/lib/modules
    3.68 +		cp $fdir/$NETDRV $MNT/lib/modules
    3.69  	else
    3.70 -		die "Xm-test requires the pcnet32 driver to run."
    3.71 +		die "Xm-test requires at minimum the 8139too.ko driver to run."
    3.72  	fi
    3.73  
    3.74  	# Make sure that modules will be installed
    3.75  	if [ -e "$MNT/etc/init.d/rcS" ]; then
    3.76  		echo "insmod /lib/modules/mii.ko" >> $MNT/etc/init.d/rcS
    3.77 -		echo "insmod /lib/modules/pcnet32.ko" >> $MNT/etc/init.d/rcS
    3.78 +		echo "insmod /lib/modules/$NETDRV" >> $MNT/etc/init.d/rcS
    3.79  	else
    3.80  		die "Failed to add insmod command to rcS file on image."
    3.81  	fi