Skip to contentSkip to conversation

Change xm-test HVM disk.img to be an iso cdrom image with grub and an initramfs

RFC PATCH In review Harry Butterworth 1 participant 4 messages Jul 21, 2006 – Aug 9, 2006

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Change xm-test HVM disk.img to be an iso cdrom image with grub and an initramfs

I have had a certain amount of pain trying to get the HVM xm-tests to run on my ubuntu box. The main problem was xm-test's reuse of the ubuntu kernel from /boot which doesn't have the ide driver or the ext2 filesystem compiled in by default. The lack of these drivers means that the xm-test HVM image which is an ext2 filesystem on an ide emulated drive doesn't boot so most of the HVM test suite fails.

This patch changes the xm-test build process and the python test library such that the HVM image is built as an iso cdrom image containing grub and an initramfs.

This seems to be the best way to fix the ubuntu boot problems and will hopefully be compatible with all the other distros as well.

The advantages of this approach are as follows:

1) Using grub eliminates the requirement for lilo for HVM testing.
2) Creating a grub cdrom image rather than a hard disk image is more likely to work correctly with all the versions of grub we care about (some versions of grub have a problem with hard disk geometry apparently).
3) Using an initramfs image on the cdrom image should work with all 2.6 kernels that xm-test is likely to encounter. This is not dependent on any kernel config options being enabled so can't be compiled out as a module as was the problem with the ext2 image in the case of ubuntu.
4) Using an initramfs image with a ramdisk mounted for the root filesystem makes the HVM domU configuration much closer to the PV domU configuration which is likely to help us keep the test-cases common between HVM and PV.

On ubuntu, with this patch most of the HVM tests now seem to work though I am getting some random failures that I think are probably not related to the patch.

The patch must be tested on the other distributions before it can be applied.

tools/xm-test/README +11 -22
diff -r bbabdebc54ad -r 30da539f0b59 tools/xm-test/README
@@ -76,12 +76,8 @@
   # ./configure --enable-hvm-support
   # make
 
-The ramdisk/bin/create_disk_image script, which builds the full virt
-disk.img, requires Lilo 22.7+ to be installed on the system. Lilo is 
-used to install the bootloader on the disk.img.
-
-If HVM support is enabled, the ramdisk/bin/create_disk_image script
-will be run to create a full virt disk.img in the ramdisk directory. The
+If HVM support is enabled, the ramdisk/bin/create_iso_image script
+will be run to create a full virt disk.iso in the ramdisk directory. The
 script, by default, will look in /boot for the first non-Xen kernel it
 runs across. If you'd like to set xm-test to use a specific kernel,
 rather than the first one it finds in /boot, you can configure it in
@@ -94,23 +90,16 @@
 Otherwise, you can always rerun the create script using the -k option
 to use a specific kernel. 
 
-The disk.img created for HVM testing must contain a pcnet32 driver for
-network tests. The ramdisk/bin/create_disk_image script will, by default,
-look in the /lib/modules directory associated with the kernel being
-used. If you'd like to specify a different location for the driver or
-want to tell the script that the driver is built into the kernel, please
-use the "--with-driver-dir=DRVDIR" configure option. If built into
-the kernel, please use the key word "builtin" with the option:
- 
-# ./autogen
-# ./configure --enable-hvm-support --with-driver-dir=builtin
-- or -
-# ./configure --enable-hvm-support --with-driver-dir=/driver/directory
-# make
- 
-Xm-test will look for disk.img in the ramdisk directory when run by
+The disk.iso created for HVM testing must contain a driver for network
+tests.  The default set of driver modules copied to the disk.iso
+should include this.  If not, to change the set of driver modules
+copied to the disk.iso, use the "--with-hvm-modules=MODULES" option.
+
+The ramdisk/bin/create_iso_image script will look for modules in the
+/lib/modules directory associated with the kernel being used.
+
+Xm-test will look for disk.iso in the ramdisk directory when run by
 default.
-
 
 Running
 =======
tools/xm-test/configure.ac +9 -17
diff -r bbabdebc54ad -r 30da539f0b59 tools/xm-test/configure.ac
@@ -69,28 +69,20 @@
 AC_SUBST(NETMASK)
 
 AC_ARG_WITH(hvm-kernel,
-      [[  --with-hvm-kernel=kernel       Use this kernel for hvm disk.img testing]],
-      HVMKERNEL=$withval,
-      HVMKERNEL="no")
+      [ --with-hvm-kernel=kernel Use this kernel for hvm disk.iso testing ],
+      [ HVMKERNEL="$withval" ],
+      [ HVMKERNEL="default" ])
 
 dnl substitute @HVMKERNEL@ in all Makefiles
 AC_SUBST(HVMKERNEL)
 
-AC_ARG_WITH(driver-dir,
-	[[  --with-driver-dir=drvdir       Look in this directory for the pcnet32 driver for the vmx disk.img. drvdir can equal key word "builtin" if driver is built into the kernel]],
-	DRVDIR=$withval,
-	DRVDIR="no")
+AC_ARG_WITH(hvm-modules,
+	[ --with-hvm-modules=modules Use these modules for hvm disk.iso testing [[default="8139too"]]],
+	[ HVMMODULES="$withval" ],
+	[ HVMMODULES="8139too" ])
 
-dnl substitute @DRVDIR@ in all Makefiles
-AC_SUBST(DRVDIR)
-
-NETDRV="8139too.ko"
-AC_ARG_WITH(network-drv,
-	[  --with-network-drv=driver Set network driver to use [[default="8139too.ko"]]],
-	[ NETDRV="$withval" ])
-
-dnl substitute @DRVDIR@ in all Makefiles
-AC_SUBST(NETDRV)
+dnl substitute @HVMMODULES@ in all Makefiles
+AC_SUBST(HVMMODULES)
 
 AC_SUBST(TENV)
 AC_SUBST(PACKAGE_VERSION)
tools/xm-test/lib/XmTestLib/XenDomain.py +1 -2
diff -r bbabdebc54ad -r 30da539f0b59 tools/xm-test/lib/XmTestLib/XenDomain.py
@@ -76,8 +76,7 @@
                     "vcpus"        : 1,
                     "acpi"         : 0,
                     "apic"         : 0,
-                    "disk"         : ["file:%s/disk.img,ioemu:%s,w!" %
-                                   (getRdPath(), BLOCK_ROOT_DEV)],
+                    "cdrom"        : "%s/disk.iso" % getRdPath(),
                     "kernel"       : "/usr/lib/xen/boot/hvmloader",
                     "builder"      : "hvm",
                     "sdl"          : 0,
tools/xm-test/ramdisk/Makefile.am +6 -15
diff -r bbabdebc54ad -r 30da539f0b59 tools/xm-test/ramdisk/Makefile.am
@@ -10,7 +10,7 @@
 
 BR_ROOT = build_i386/root
 
-HVM_SCRIPT = bin/create_disk_image
+HVM_SCRIPT = bin/create_iso_image
 
 XMTEST_MAJ_VER = $(shell echo @PACKAGE_VERSION@ | perl -pe 's/(\d+)\.(\d+)\.\d+/\1.\2/')
 XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER).img
@@ -18,7 +18,7 @@
 EXTRA_ROOT_DIRS = sys
 
 if HVM
-all: initrd.img disk.img
+all: initrd.img disk.iso
 else
 all: initrd.img
 endif
@@ -47,19 +47,10 @@
 initrd.img: $(XMTEST_VER_IMG)
 	ln -sf $(XMTEST_VER_IMG) initrd.img
 
-disk.img: existing
+disk.iso: existing
 	chmod a+x $(HVM_SCRIPT)
-	@if test ! "$(HVMKERNEL)" = "no" -a ! "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
-			-d $(DRVDIR) -n $(NETDRV); \
-	elif test "$(HVMKERNEL)" = "no" -a ! "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -d $(DRVDIR) -n $(NETDRV); \
-	elif test ! "$(HVMKERNEL)" = "no" -a "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
-			-n $(NETDRV); \
-	else \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -n $(NETDRV); \
-	fi
+	$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
+			-m $(HVMMODULES);
 
 existing:
 	@if [ -n "$(INITRD)" ] && [ ! -f $(XMTEST_VER_IMG) ] ; then \
@@ -79,4 +70,4 @@
 	rm -f *~
 	rm -f initrd.img
 	rm -f $(BR_TAR)
-	rm -f disk.img
+	rm -f disk.iso
tools/xm-test/ramdisk/bin/create_iso_image new file +186 -0

186 lines not on this page · raw message

tools/xm-test/ramdisk/bin/create_disk_image deleted +0 -384

384 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 30 lines · Harry Butterworth

I have had a certain amount of pain trying to get the HVM xm-tests to run on my ubuntu box. The main problem was xm-test's reuse of the ubuntu kernel from /boot which doesn't have the ide driver or the ext2 filesystem compiled in by default. The lack of these drivers means that the xm-test HVM image which is an ext2 filesystem on an ide emulated drive doesn't boot so most of the HVM test suite fails.

This patch changes the xm-test build process and the python test library such that the HVM image is built as an iso cdrom image containing grub and an initramfs.

This seems to be the best way to fix the ubuntu boot problems and will hopefully be compatible with all the other distros as well.

The advantages of this approach are as follows:

1) Using grub eliminates the requirement for lilo for HVM testing.
2) Creating a grub cdrom image rather than a hard disk image is more likely to work correctly with all the versions of grub we care about (some versions of grub have a problem with hard disk geometry apparently).
3) Using an initramfs image on the cdrom image should work with all 2.6 kernels that xm-test is likely to encounter. This is not dependent on any kernel config options being enabled so can't be compiled out as a module as was the problem with the ext2 image in the case of ubuntu.
4) Using an initramfs image with a ramdisk mounted for the root filesystem makes the HVM domU configuration much closer to the PV domU configuration which is likely to help us keep the test-cases common between HVM and PV.

Quoted 6 lines

On ubuntu, with this patch most of the HVM tests now seem to work though I am getting some random failures that I think are probably not related to the patch.

The patch must be tested on the other distributions before it can be applied.

This new version of the patch adds the af_packet module to the list of modules installed on the ramdisk by default. This gets a few of the network tests working.

tools/xm-test/README +11 -22
diff -r d2bf1a7cc131 -r cfd366733603 tools/xm-test/README
@@ -76,12 +76,8 @@
   # ./configure --enable-hvm-support
   # make
 
-The ramdisk/bin/create_disk_image script, which builds the full virt
-disk.img, requires Lilo 22.7+ to be installed on the system. Lilo is 
-used to install the bootloader on the disk.img.
-
-If HVM support is enabled, the ramdisk/bin/create_disk_image script
-will be run to create a full virt disk.img in the ramdisk directory. The
+If HVM support is enabled, the ramdisk/bin/create_iso_image script
+will be run to create a full virt disk.iso in the ramdisk directory. The
 script, by default, will look in /boot for the first non-Xen kernel it
 runs across. If you'd like to set xm-test to use a specific kernel,
 rather than the first one it finds in /boot, you can configure it in
@@ -94,23 +90,16 @@
 Otherwise, you can always rerun the create script using the -k option
 to use a specific kernel. 
 
-The disk.img created for HVM testing must contain a pcnet32 driver for
-network tests. The ramdisk/bin/create_disk_image script will, by default,
-look in the /lib/modules directory associated with the kernel being
-used. If you'd like to specify a different location for the driver or
-want to tell the script that the driver is built into the kernel, please
-use the "--with-driver-dir=DRVDIR" configure option. If built into
-the kernel, please use the key word "builtin" with the option:
- 
-# ./autogen
-# ./configure --enable-hvm-support --with-driver-dir=builtin
-- or -
-# ./configure --enable-hvm-support --with-driver-dir=/driver/directory
-# make
- 
-Xm-test will look for disk.img in the ramdisk directory when run by
+The disk.iso created for HVM testing must contain a driver for network
+tests.  The default set of driver modules copied to the disk.iso
+should include this.  If not, to change the set of driver modules
+copied to the disk.iso, use the "--with-hvm-modules=MODULES" option.
+
+The ramdisk/bin/create_iso_image script will look for modules in the
+/lib/modules directory associated with the kernel being used.
+
+Xm-test will look for disk.iso in the ramdisk directory when run by
 default.
-
 
 Running
 =======
tools/xm-test/configure.ac +9 -17
diff -r d2bf1a7cc131 -r cfd366733603 tools/xm-test/configure.ac
@@ -69,28 +69,20 @@
 AC_SUBST(NETMASK)
 
 AC_ARG_WITH(hvm-kernel,
-      [[  --with-hvm-kernel=kernel       Use this kernel for hvm disk.img testing]],
-      HVMKERNEL=$withval,
-      HVMKERNEL="no")
+      [ --with-hvm-kernel=kernel Use this kernel for hvm disk.iso testing ],
+      [ HVMKERNEL="$withval" ],
+      [ HVMKERNEL="default" ])
 
 dnl substitute @HVMKERNEL@ in all Makefiles
 AC_SUBST(HVMKERNEL)
 
-AC_ARG_WITH(driver-dir,
-	[[  --with-driver-dir=drvdir       Look in this directory for the pcnet32 driver for the vmx disk.img. drvdir can equal key word "builtin" if driver is built into the kernel]],
-	DRVDIR=$withval,
-	DRVDIR="no")
+AC_ARG_WITH(hvm-modules,
+	[ --with-hvm-modules=modules Use these modules for hvm disk.iso testing [[default="8139too"]]],
+	[ HVMMODULES="$withval" ],
+	[ HVMMODULES="'8139too af_packet'" ])
 
-dnl substitute @DRVDIR@ in all Makefiles
-AC_SUBST(DRVDIR)
-
-NETDRV="8139too.ko"
-AC_ARG_WITH(network-drv,
-	[  --with-network-drv=driver Set network driver to use [[default="8139too.ko"]]],
-	[ NETDRV="$withval" ])
-
-dnl substitute @DRVDIR@ in all Makefiles
-AC_SUBST(NETDRV)
+dnl substitute @HVMMODULES@ in all Makefiles
+AC_SUBST(HVMMODULES)
 
 AC_SUBST(TENV)
 AC_SUBST(PACKAGE_VERSION)
tools/xm-test/lib/XmTestLib/XenDomain.py +1 -2
diff -r d2bf1a7cc131 -r cfd366733603 tools/xm-test/lib/XmTestLib/XenDomain.py
@@ -76,8 +76,7 @@
                     "vcpus"        : 1,
                     "acpi"         : 0,
                     "apic"         : 0,
-                    "disk"         : ["file:%s/disk.img,ioemu:%s,w!" %
-                                   (getRdPath(), BLOCK_ROOT_DEV)],
+                    "cdrom"        : "%s/disk.iso" % getRdPath(),
                     "kernel"       : "/usr/lib/xen/boot/hvmloader",
                     "builder"      : "hvm",
                     "sdl"          : 0,
tools/xm-test/ramdisk/Makefile.am +6 -15
diff -r d2bf1a7cc131 -r cfd366733603 tools/xm-test/ramdisk/Makefile.am
@@ -10,7 +10,7 @@
 
 BR_ROOT = build_i386/root
 
-HVM_SCRIPT = bin/create_disk_image
+HVM_SCRIPT = bin/create_iso_image
 
 XMTEST_MAJ_VER = $(shell echo @PACKAGE_VERSION@ | perl -pe 's/(\d+)\.(\d+)\.\d+/\1.\2/')
 XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER).img
@@ -18,7 +18,7 @@
 EXTRA_ROOT_DIRS = sys
 
 if HVM
-all: initrd.img disk.img
+all: initrd.img disk.iso
 else
 all: initrd.img
 endif
@@ -47,19 +47,10 @@
 initrd.img: $(XMTEST_VER_IMG)
 	ln -sf $(XMTEST_VER_IMG) initrd.img
 
-disk.img: existing
+disk.iso: existing
 	chmod a+x $(HVM_SCRIPT)
-	@if test ! "$(HVMKERNEL)" = "no" -a ! "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
-			-d $(DRVDIR) -n $(NETDRV); \
-	elif test "$(HVMKERNEL)" = "no" -a ! "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -d $(DRVDIR) -n $(NETDRV); \
-	elif test ! "$(HVMKERNEL)" = "no" -a "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
-			-n $(NETDRV); \
-	else \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -n $(NETDRV); \
-	fi
+	$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
+			-m $(HVMMODULES);
 
 existing:
 	@if [ -n "$(INITRD)" ] && [ ! -f $(XMTEST_VER_IMG) ] ; then \
@@ -79,4 +70,4 @@
 	rm -f *~
 	rm -f initrd.img
 	rm -f $(BR_TAR)
-	rm -f disk.img
+	rm -f disk.iso
tools/xm-test/ramdisk/bin/create_iso_image new file +186 -0

186 lines not on this page · raw message

tools/xm-test/ramdisk/bin/create_disk_image deleted +0 -384

384 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 35 lines · Harry Butterworth
Quoted 34 lines · Harry Butterworth

I have had a certain amount of pain trying to get the HVM xm-tests to run on my ubuntu box. The main problem was xm-test's reuse of the ubuntu kernel from /boot which doesn't have the ide driver or the ext2 filesystem compiled in by default. The lack of these drivers means that the xm-test HVM image which is an ext2 filesystem on an ide emulated drive doesn't boot so most of the HVM test suite fails.

This patch changes the xm-test build process and the python test library such that the HVM image is built as an iso cdrom image containing grub and an initramfs.

This seems to be the best way to fix the ubuntu boot problems and will hopefully be compatible with all the other distros as well.

The advantages of this approach are as follows:

1) Using grub eliminates the requirement for lilo for HVM testing.
2) Creating a grub cdrom image rather than a hard disk image is more likely to work correctly with all the versions of grub we care about (some versions of grub have a problem with hard disk geometry apparently).
3) Using an initramfs image on the cdrom image should work with all 2.6 kernels that xm-test is likely to encounter. This is not dependent on any kernel config options being enabled so can't be compiled out as a module as was the problem with the ext2 image in the case of ubuntu.
4) Using an initramfs image with a ramdisk mounted for the root filesystem makes the HVM domU configuration much closer to the PV domU configuration which is likely to help us keep the test-cases common between HVM and PV.

On ubuntu, with this patch most of the HVM tests now seem to work though I am getting some random failures that I think are probably not related to the patch.

Quoted 8 lines
Quoted 2 lines

The patch must be tested on the other distributions before it can be applied.

This new version of the patch adds the af_packet module to the list of modules installed on the ramdisk by default. This gets a few of the network tests working.

This third version of the patch changes the domain configuration for the new way of specifying a cdrom introduced in changeset:
10921:4c2fab8f8c3420df750af2f3d4dc8cf377f2f418

tools/xm-test/README +11 -22
diff -r ffa5b2975dff -r e769a9931ec0 tools/xm-test/README
@@ -76,12 +76,8 @@
   # ./configure --enable-hvm-support
   # make
 
-The ramdisk/bin/create_disk_image script, which builds the full virt
-disk.img, requires Lilo 22.7+ to be installed on the system. Lilo is 
-used to install the bootloader on the disk.img.
-
-If HVM support is enabled, the ramdisk/bin/create_disk_image script
-will be run to create a full virt disk.img in the ramdisk directory. The
+If HVM support is enabled, the ramdisk/bin/create_iso_image script
+will be run to create a full virt disk.iso in the ramdisk directory. The
 script, by default, will look in /boot for the first non-Xen kernel it
 runs across. If you'd like to set xm-test to use a specific kernel,
 rather than the first one it finds in /boot, you can configure it in
@@ -94,23 +90,16 @@
 Otherwise, you can always rerun the create script using the -k option
 to use a specific kernel. 
 
-The disk.img created for HVM testing must contain a pcnet32 driver for
-network tests. The ramdisk/bin/create_disk_image script will, by default,
-look in the /lib/modules directory associated with the kernel being
-used. If you'd like to specify a different location for the driver or
-want to tell the script that the driver is built into the kernel, please
-use the "--with-driver-dir=DRVDIR" configure option. If built into
-the kernel, please use the key word "builtin" with the option:
- 
-# ./autogen
-# ./configure --enable-hvm-support --with-driver-dir=builtin
-- or -
-# ./configure --enable-hvm-support --with-driver-dir=/driver/directory
-# make
- 
-Xm-test will look for disk.img in the ramdisk directory when run by
+The disk.iso created for HVM testing must contain a driver for network
+tests.  The default set of driver modules copied to the disk.iso
+should include this.  If not, to change the set of driver modules
+copied to the disk.iso, use the "--with-hvm-modules=MODULES" option.
+
+The ramdisk/bin/create_iso_image script will look for modules in the
+/lib/modules directory associated with the kernel being used.
+
+Xm-test will look for disk.iso in the ramdisk directory when run by
 default.
-
 
 Running
 =======
tools/xm-test/configure.ac +9 -17
diff -r ffa5b2975dff -r e769a9931ec0 tools/xm-test/configure.ac
@@ -69,28 +69,20 @@
 AC_SUBST(NETMASK)
 
 AC_ARG_WITH(hvm-kernel,
-      [[  --with-hvm-kernel=kernel       Use this kernel for hvm disk.img testing]],
-      HVMKERNEL=$withval,
-      HVMKERNEL="no")
+      [ --with-hvm-kernel=kernel Use this kernel for hvm disk.iso testing ],
+      [ HVMKERNEL="$withval" ],
+      [ HVMKERNEL="default" ])
 
 dnl substitute @HVMKERNEL@ in all Makefiles
 AC_SUBST(HVMKERNEL)
 
-AC_ARG_WITH(driver-dir,
-	[[  --with-driver-dir=drvdir       Look in this directory for the pcnet32 driver for the vmx disk.img. drvdir can equal key word "builtin" if driver is built into the kernel]],
-	DRVDIR=$withval,
-	DRVDIR="no")
+AC_ARG_WITH(hvm-modules,
+	[ --with-hvm-modules=modules Use these modules for hvm disk.iso testing [[default="8139too"]]],
+	[ HVMMODULES="$withval" ],
+	[ HVMMODULES="'8139too af_packet'" ])
 
-dnl substitute @DRVDIR@ in all Makefiles
-AC_SUBST(DRVDIR)
-
-NETDRV="8139too.ko"
-AC_ARG_WITH(network-drv,
-	[  --with-network-drv=driver Set network driver to use [[default="8139too.ko"]]],
-	[ NETDRV="$withval" ])
-
-dnl substitute @DRVDIR@ in all Makefiles
-AC_SUBST(NETDRV)
+dnl substitute @HVMMODULES@ in all Makefiles
+AC_SUBST(HVMMODULES)
 
 AC_SUBST(TENV)
 AC_SUBST(PACKAGE_VERSION)
tools/xm-test/lib/XmTestLib/XenDomain.py +2 -2
diff -r ffa5b2975dff -r e769a9931ec0 tools/xm-test/lib/XmTestLib/XenDomain.py
@@ -76,8 +76,8 @@
                     "vcpus"        : 1,
                     "acpi"         : 0,
                     "apic"         : 0,
-                    "disk"         : ["file:%s/disk.img,ioemu:%s,w!" %
-                                   (getRdPath(), BLOCK_ROOT_DEV)],
+                    "disk"         : "file:%s/disk.iso,hdc:cdrom,r" % getRdPath(),
+                    "boot"         : "d",
                     "kernel"       : "/usr/lib/xen/boot/hvmloader",
                     "builder"      : "hvm",
                     "sdl"          : 0,
tools/xm-test/ramdisk/Makefile.am +6 -15
diff -r ffa5b2975dff -r e769a9931ec0 tools/xm-test/ramdisk/Makefile.am
@@ -10,7 +10,7 @@
 
 BR_ROOT = build_i386/root
 
-HVM_SCRIPT = bin/create_disk_image
+HVM_SCRIPT = bin/create_iso_image
 
 XMTEST_MAJ_VER = $(shell echo @PACKAGE_VERSION@ | perl -pe 's/(\d+)\.(\d+)\.\d+/\1.\2/')
 XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER).img
@@ -18,7 +18,7 @@
 EXTRA_ROOT_DIRS = sys
 
 if HVM
-all: initrd.img disk.img
+all: initrd.img disk.iso
 else
 all: initrd.img
 endif
@@ -47,19 +47,10 @@
 initrd.img: $(XMTEST_VER_IMG)
 	ln -sf $(XMTEST_VER_IMG) initrd.img
 
-disk.img: existing
+disk.iso: existing
 	chmod a+x $(HVM_SCRIPT)
-	@if test ! "$(HVMKERNEL)" = "no" -a ! "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
-			-d $(DRVDIR) -n $(NETDRV); \
-	elif test "$(HVMKERNEL)" = "no" -a ! "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -d $(DRVDIR) -n $(NETDRV); \
-	elif test ! "$(HVMKERNEL)" = "no" -a "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
-			-n $(NETDRV); \
-	else \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -n $(NETDRV); \
-	fi
+	$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
+			-m $(HVMMODULES);
 
 existing:
 	@if [ -n "$(INITRD)" ] && [ ! -f $(XMTEST_VER_IMG) ] ; then \
@@ -79,4 +70,4 @@
 	rm -f *~
 	rm -f initrd.img
 	rm -f $(BR_TAR)
-	rm -f disk.img
+	rm -f disk.iso
tools/xm-test/ramdisk/bin/create_iso_image new file +186 -0

186 lines not on this page · raw message

tools/xm-test/ramdisk/bin/create_disk_image deleted +0 -384

384 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
Quoted 43 lines · Harry Butterworth
Quoted 42 lines · Harry Butterworth
Quoted 30 lines · Harry Butterworth

I have had a certain amount of pain trying to get the HVM xm-tests to run on my ubuntu box. The main problem was xm-test's reuse of the ubuntu kernel from /boot which doesn't have the ide driver or the ext2 filesystem compiled in by default. The lack of these drivers means that the xm-test HVM image which is an ext2 filesystem on an ide emulated drive doesn't boot so most of the HVM test suite fails.

This patch changes the xm-test build process and the python test library such that the HVM image is built as an iso cdrom image containing grub and an initramfs.

This seems to be the best way to fix the ubuntu boot problems and will hopefully be compatible with all the other distros as well.

The advantages of this approach are as follows:

1) Using grub eliminates the requirement for lilo for HVM testing.
2) Creating a grub cdrom image rather than a hard disk image is more likely to work correctly with all the versions of grub we care about (some versions of grub have a problem with hard disk geometry apparently).
3) Using an initramfs image on the cdrom image should work with all 2.6 kernels that xm-test is likely to encounter. This is not dependent on any kernel config options being enabled so can't be compiled out as a module as was the problem with the ext2 image in the case of ubuntu.
4) Using an initramfs image with a ramdisk mounted for the root filesystem makes the HVM domU configuration much closer to the PV domU configuration which is likely to help us keep the test-cases common between HVM and PV.

Quoted 6 lines

On ubuntu, with this patch most of the HVM tests now seem to work though I am getting some random failures that I think are probably not related to the patch.

The patch must be tested on the other distributions before it can be applied.

This new version of the patch adds the af_packet module to the list of modules installed on the ramdisk by default. This gets a few of the network tests working.

Quoted 7 lines
Quoted 1 line

This third version of the patch changes the domain configuration for the new way of specifying a cdrom introduced in changeset:
10921:4c2fab8f8c3420df750af2f3d4dc8cf377f2f418

This fourth version of the patch adds an alternate path when looking for the stage2_eltorito file used to make the iso image bootable. Older grub installations put it in a different place.

Thanks to Ricardo C Gonzalez for some testing here.

tools/xm-test/README +11 -22
diff -r 3a2fee0d84f7 -r 7518bbf1c8f0 tools/xm-test/README
@@ -76,12 +76,8 @@
   # ./configure --enable-hvm-support
   # make
 
-The ramdisk/bin/create_disk_image script, which builds the full virt
-disk.img, requires Lilo 22.7+ to be installed on the system. Lilo is 
-used to install the bootloader on the disk.img.
-
-If HVM support is enabled, the ramdisk/bin/create_disk_image script
-will be run to create a full virt disk.img in the ramdisk directory. The
+If HVM support is enabled, the ramdisk/bin/create_iso_image script
+will be run to create a full virt disk.iso in the ramdisk directory. The
 script, by default, will look in /boot for the first non-Xen kernel it
 runs across. If you'd like to set xm-test to use a specific kernel,
 rather than the first one it finds in /boot, you can configure it in
@@ -94,23 +90,16 @@
 Otherwise, you can always rerun the create script using the -k option
 to use a specific kernel. 
 
-The disk.img created for HVM testing must contain a pcnet32 driver for
-network tests. The ramdisk/bin/create_disk_image script will, by default,
-look in the /lib/modules directory associated with the kernel being
-used. If you'd like to specify a different location for the driver or
-want to tell the script that the driver is built into the kernel, please
-use the "--with-driver-dir=DRVDIR" configure option. If built into
-the kernel, please use the key word "builtin" with the option:
- 
-# ./autogen
-# ./configure --enable-hvm-support --with-driver-dir=builtin
-- or -
-# ./configure --enable-hvm-support --with-driver-dir=/driver/directory
-# make
- 
-Xm-test will look for disk.img in the ramdisk directory when run by
+The disk.iso created for HVM testing must contain a driver for network
+tests.  The default set of driver modules copied to the disk.iso
+should include this.  If not, to change the set of driver modules
+copied to the disk.iso, use the "--with-hvm-modules=MODULES" option.
+
+The ramdisk/bin/create_iso_image script will look for modules in the
+/lib/modules directory associated with the kernel being used.
+
+Xm-test will look for disk.iso in the ramdisk directory when run by
 default.
-
 
 Running
 =======
tools/xm-test/configure.ac +9 -17
diff -r 3a2fee0d84f7 -r 7518bbf1c8f0 tools/xm-test/configure.ac
@@ -69,28 +69,20 @@
 AC_SUBST(NETMASK)
 
 AC_ARG_WITH(hvm-kernel,
-      [[  --with-hvm-kernel=kernel       Use this kernel for hvm disk.img testing]],
-      HVMKERNEL=$withval,
-      HVMKERNEL="no")
+      [ --with-hvm-kernel=kernel Use this kernel for hvm disk.iso testing ],
+      [ HVMKERNEL="$withval" ],
+      [ HVMKERNEL="default" ])
 
 dnl substitute @HVMKERNEL@ in all Makefiles
 AC_SUBST(HVMKERNEL)
 
-AC_ARG_WITH(driver-dir,
-	[[  --with-driver-dir=drvdir       Look in this directory for the pcnet32 driver for the vmx disk.img. drvdir can equal key word "builtin" if driver is built into the kernel]],
-	DRVDIR=$withval,
-	DRVDIR="no")
+AC_ARG_WITH(hvm-modules,
+	[ --with-hvm-modules=modules Use these modules for hvm disk.iso testing [[default="8139too"]]],
+	[ HVMMODULES="$withval" ],
+	[ HVMMODULES="'8139too af_packet'" ])
 
-dnl substitute @DRVDIR@ in all Makefiles
-AC_SUBST(DRVDIR)
-
-NETDRV="8139too.ko"
-AC_ARG_WITH(network-drv,
-	[  --with-network-drv=driver Set network driver to use [[default="8139too.ko"]]],
-	[ NETDRV="$withval" ])
-
-dnl substitute @DRVDIR@ in all Makefiles
-AC_SUBST(NETDRV)
+dnl substitute @HVMMODULES@ in all Makefiles
+AC_SUBST(HVMMODULES)
 
 AC_SUBST(TENV)
 AC_SUBST(PACKAGE_VERSION)
tools/xm-test/lib/XmTestLib/XenDomain.py +2 -2
diff -r 3a2fee0d84f7 -r 7518bbf1c8f0 tools/xm-test/lib/XmTestLib/XenDomain.py
@@ -76,8 +76,8 @@
                     "vcpus"        : 1,
                     "acpi"         : 0,
                     "apic"         : 0,
-                    "disk"         : ["file:%s/disk.img,ioemu:%s,w!" %
-                                   (getRdPath(), BLOCK_ROOT_DEV)],
+                    "disk"         : "file:%s/disk.iso,hdc:cdrom,r" % getRdPath(),
+                    "boot"         : "d",
                     "kernel"       : "/usr/lib/xen/boot/hvmloader",
                     "builder"      : "hvm",
                     "sdl"          : 0,
tools/xm-test/ramdisk/Makefile.am +6 -15
diff -r 3a2fee0d84f7 -r 7518bbf1c8f0 tools/xm-test/ramdisk/Makefile.am
@@ -10,7 +10,7 @@
 
 BR_ROOT = build_i386/root
 
-HVM_SCRIPT = bin/create_disk_image
+HVM_SCRIPT = bin/create_iso_image
 
 XMTEST_MAJ_VER = $(shell echo @PACKAGE_VERSION@ | perl -pe 's/(\d+)\.(\d+)\.\d+/\1.\2/')
 XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER).img
@@ -18,7 +18,7 @@
 EXTRA_ROOT_DIRS = sys
 
 if HVM
-all: initrd.img disk.img
+all: initrd.img disk.iso
 else
 all: initrd.img
 endif
@@ -47,19 +47,10 @@
 initrd.img: $(XMTEST_VER_IMG)
 	ln -sf $(XMTEST_VER_IMG) initrd.img
 
-disk.img: existing
+disk.iso: existing
 	chmod a+x $(HVM_SCRIPT)
-	@if test ! "$(HVMKERNEL)" = "no" -a ! "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
-			-d $(DRVDIR) -n $(NETDRV); \
-	elif test "$(HVMKERNEL)" = "no" -a ! "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -d $(DRVDIR) -n $(NETDRV); \
-	elif test ! "$(HVMKERNEL)" = "no" -a "$(DRVDIR)" = "no"; then \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
-			-n $(NETDRV); \
-	else \
-		$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -n $(NETDRV); \
-	fi
+	$(HVM_SCRIPT) -r $(XMTEST_VER_IMG) -k $(HVMKERNEL) \
+			-m $(HVMMODULES);
 
 existing:
 	@if [ -n "$(INITRD)" ] && [ ! -f $(XMTEST_VER_IMG) ] ; then \
@@ -79,4 +70,4 @@
 	rm -f *~
 	rm -f initrd.img
 	rm -f $(BR_TAR)
-	rm -f disk.img
+	rm -f disk.iso
tools/xm-test/ramdisk/bin/create_iso_image new file +193 -0

193 lines not on this page · raw message

tools/xm-test/ramdisk/bin/create_disk_image deleted +0 -384

384 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel