Set up XenLinux kernel 2.6.34.7 aka Suse under Xen 4.0.1 on top of F14

October 25, 2010

Straight forward attempt to load 2.6.34.7 kernel xenified aka Suse under Fedora’s 14 Xen 4.0.1 generates following output to console :-

Starting udev: udevd-work[591]: kernel-provided name 'pci_iomul' and NAME= 'xen/pci_iomul' disagree, please use SYMLINK+= or change the kernel to provide the proper name

udevd-work[539]: kernel-provided name 'evtchn' and NAME= 'xen/evtchn' disagree, please use SYMLINK+= or change the kernel to provide the proper name

Situation described in [1] for pvops kernel on May 26 2010 now occurs for XenLinux kernel. In case [1],[2] all pvops xen backend devices have been renamed like xen_*. To get rid of messages above it’s also possible via patch xen-backend.rules keeping kernel’s names for xen backend devices the same

--- a/tools/hotplug/Linux/xen-backend.rules	2010-10-25 00:50:07.812223772 +0400
+++ b/tools/hotplug/Linux/xen-backend.rules	2010-10-24 23:58:22.000000000 +0400
@@ -6,6 +6,8 @@
 SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ACTION=="offline", RUN+="$env{script} offline"
 SUBSYSTEM=="xen-backend", KERNEL=="vscsi*", RUN+="/etc/xen/scripts/vscsi $env{ACTION}"
 SUBSYSTEM=="xen-backend", ACTION=="remove", RUN+="/etc/xen/scripts/xen-hotplug-cleanup"
-KERNEL=="evtchn", NAME="xen/%k"
+KERNEL=="evtchn", SYMLINK+="xen/%k"
 KERNEL=="blktap[0-9]*", NAME="xen/%k"
-KERNEL=="pci_iomul", NAME="xen/%k"
+KERNEL=="pci_iomul", SYMLINK+="xen/%k"
+KERNEL=="gntdev", SYMLINK+="xen/%k"
+KERNELS=="xen", KERNEL=="xvd*", SUBSYSTEM=="block", OPTIONS+="last_rule"

Download from the Net xen-4.0.1-6.fc14.src.rpm and install it. Add patch above as udev-rules.patch to /root/rpmbuild/SOURCES
folder and update /root/rpmbuild/SPECS/xen.spec correspondently to process this patch. Install ( or update) Xen 4.0.1 on F14 via

yum install xen-4.0.1-7.fc14.x86_64.rpm \
xen-debuginfo-4.0.1-7.fc14.x86_64.rpm \
xen-devel-4.0.1-7.fc14.x86_64.rpm \
xen-doc-4.0.1-7.fc14.x86_64.rpm \
xen-hypervisor-4.0.1-7.fc14.x86_64.rpm \
xen-libs-4.0.1-7.fc14.x86_64.rpm \
xen-licenses-4.0.1-7.fc14.x86_64.rpm \
xen-runtime-4.0.1-7.fc14.x86_64.rpm

Build 2.6.34.7 xenified aka Suse kernel. Download Andrew Lyon’s rebased patches set V.5 (2.6.34)

# cd /usr/src/xenLinux/
# wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.34-5.tar.bz2

Untar linux-2.6.34.7.tar.bz2 and apply patches.

# cd /usr/src/xenLinux/
# bzcat linux-2.6.34.7.tar.bz2 | tar xf -
# mkdir -p xen-patches-2.6.34-5
# cd xen-patches-2.6.34-5
# bzcat ../xen-patches-2.6.34-5.tar.bz2 | tar xf -
# cd ../linux-2.6.34.7

Run script

#!/bin/bash
for P in `ls ../xen-patches-2.6.34-5/6*.patch1 | sort `
do
patch -p1 -s -i $P
if [ $? = 0 ]; then
echo $P applied
else
echo "Error processing "$P
exit 1
fi
done

Build kernel :-

# make menuconfig
# make -j(x)(number_of_cores)
# make modules_install install
# dracut -f /boot/initramfs-2.6.34.7-0.5-xen.img 2.6.34.7-0.5-xen







Get .config file for x86_64

Modify /etc/rc.local as follows

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

if (uname -r |grep 2.6.34.7-0.5-xen) ; then
modprobe evtchn
modprobe blktap
modprobe blkbk
modprobe xenblk
modprobe netbk
modprobe gntdev
modprobe usbbk
fi
touch /var/lock/subsys/local

Setup Libvirt 0.8.3 :-

# yum install virtinst python-virtinst libvirt \
libvirt-python virt-viewer virt-manager

Reboot into Xen Environment :-

title Xen 4.0.1 Fedora (2.6.34.7-0.5-xen) (/dev/sda9)
root (hd0,8)
kernel /xen.gz dom0_mem=1024M
module /vmlinuz-2.6.34.7-0.5-xen ro root=/dev/mapper/vg_fedora14-lv_root LANG=US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us
module /initramfs-2.6.34.7-0.5-xen.img

Verify environment :-

[root@fedora14 ~]# ls -l /dev/xen
total 0
lrwxrwxrwx 1 root root 9 Oct 25 17:48 evtchn -> ../evtchn
lrwxrwxrwx 1 root root 9 Oct 25 17:48 gntdev -> ../gntdev
lrwxrwxrwx 1 root root 12 Oct 25 17:48 pci_iomul -> ../pci_iomul

[root@fedora14 ~]# xm info
host : fedora14
release : 2.6.34.7-0.5-xen
version : #3 SMP Mon Oct 25 13:29:54 MSD 2010
machine : x86_64
nr_cpus : 4
nr_nodes : 1
cores_per_socket : 4
threads_per_core : 1
cpu_mhz : 2833
hw_caps : bfebfbff:20100800:00000000:00000940:0008e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8190
free_memory : 7083
node_to_cpu : node0:0-3
node_to_memory : node0:7083
node_to_dma32_mem : node0:3259
max_node_id : 0
xen_major : 4
xen_minor : 0
xen_extra : .1
xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler : credit
xen_pagesize : 4096
platform_params : virt_start=0xffff800000000000
xen_changeset : unavailable
xen_commandline : dom0_mem=1024M
cc_compiler : gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)
cc_compile_by : root
cc_compile_domain :
cc_compile_date : Mon Oct 25 12:12:09 MSD 2010
xend_config_format : 4

[root@fedora14 ~]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.90e6ba2d11eb no eth0
virbr0 8000.000000000000 yes




References
1.http://lists.xensource.com/archives/html/xen-devel/2010-05/msg01310.html
2.http://lists.xensource.com/archives/html/xen-devel/2010-05/msg01379.html


kernel.hack

October 20, 2010
--- arch/x86/Makefile.orig 	2010-05-02 12:24:38.000000000 -0400
+++ arch/x86/Makefile	2010-05-02 12:27:01.000000000 -0400
@@ -155,18 +155,19 @@
 LDFLAGS_vmlinux := -e startup_64
 endif

-# Default kernel to build -all: vmlinuz +endif +## Default kernel to build +#all: vmlinuz
-# KBUILD_IMAGE specifies the target image being built -KBUILD_IMAGE := $(boot)/vmlinuz +## KBUILD_IMAGE specifies the target image being built +#KBUILD_IMAGE := $(boot)/vmlinuz
-vmlinuz: vmlinux - $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) - $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot - $(Q)ln -fsn ../../x86/boot/$@ $(objtree)/arch/$(UTS_MACHINE)/boot/$@ -else -# Default kernel to build +#vmlinuz: vmlinux +# $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) +# $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot +# $(Q)ln -fsn ../../x86/boot/$@ $(objtree)/arch/$(UTS_MACHINE)/boot/$@ +#else +## Default kernel to build all: bzImage
# KBUILD_IMAGE specify target image being built @@ -176,7 +177,7 @@ $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@ -endif +#endif $(BOOT_TARGETS): vmlinux $(Q)$(MAKE) $(build)=$(boot) $@

XenLinux kernel 2.6.34.7 aka Suse under Xen 4.0.1 on top of Ubuntu 10.10 Desktop

October 17, 2010

Following post is a brief instruction of port 2.6.34.7 xenified aka Suse kernel to Ubuntu 10.10 desktop , to support Dom0 under Xen 4.0.1. Vanilla 2.6.34.7 gets patched via Andrew Lyon’s rebased patch set xen-patches-2.6.34-5.tar.bz2.
Kernel configuration is similar kernel-xen config on Suse’s 11.3 . Xen back-end,evtchn,gntdev divices get loaded via /etc/init.d/xend at startup. Xen 4.0.1 and Libvirt 0.8.3 installations are just the same as in [1].

# cd /usr/src/xenLinux/
# wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.34-5.tar.bz2

Untar linux-2.6.34.7.tar.bz2 and apply patches.

# cd /usr/src/xenLinux/
# bzcat linux-2.6.34.7.tar.bz2 | tar xf -
# mkdir -p xen-patches-2.6.34-5
# cd xen-patches-2.6.34-5
# bzcat ../xen-patches-2.6.34-5.tar.bz2 | tar xf -
# cd ../linux-2.6.34.7

Run script

#!/bin/bash
for P in `ls ../xen-patches-2.6.34-5/6*.patch1 | sort `
do
patch -p1 -s -i $P
if [ $? = 0 ]; then
echo $P applied
else
echo "Error processing "$P
exit 1
fi
done

Build kernel :-

# make menuconfig
# make -j(x)(number_of_cores)
# make modules_install install
# mkinitramfs -o /boot/initrd.img-2.6.34.7-0.3-xen 2.6.34.7-0.3-xen





Link to .config file

Update /etc/init.d/xend correspondently

case "$1" in
start)
mkdir -p /var/lock/subsys
touch /var/lock/subsys/xend
test -z "$XENSTORED_ROOTDIR" || export XENSTORED_ROOTDIR
test -z "$XENCONSOLED_TRACE" || export XENCONSOLED_TRACE
[[ "$XENSTORED_TRACE" == @(yes|on|1) ]] && export XENSTORED_TRACE
[[ "$XENBACKENDD_DEBUG" == @(yes|on|1) ]] && export XENBACKENDD_DEBUG
if (uname -r |grep 2.6.34.7-0.3-xen) ; then
modprobe evtchn
modprobe blktap
modprobe blkbk
modprobe xenblk
modprobe netbk
modprobe gntdev
modprobe usbbk
fi
xend start
await_daemons_up
;;

Build in Debian way is possible after applying hack from [2].
kernel.patch


root@boris-System-P5Q3:/usr/src3/linux-2.6.34.7# patch -p0 < kernel.patch
patching file arch/x86/Makefile
Hunk #1 succeeded at 154 (offset -1 lines).
Hunk #2 succeeded at 179 (offset 2 lines).

Now build and install linux-image

aptitude install kernel-package fakeroot
export CONCURRENCY_LEVEL=(number_of_cores) +1
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-0.4-xen kernel-image kernel-headers
dpkg -i ../linux-image-2.6.34.7-0.4-xen_2.6.34.7-0.4-xen-10.00.Custom_amd64.deb

At this point we are done with kernel . Next : disable Network manager

# chkconfig network-manager off
# gedit /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Restart netwoking :-

# /etc/init.d/networking restart

Install required packages

apt-get install libcurl4-openssl-dev \
xserver-xorg-dev \
mercurial gitk \
build-essential \
libncurses5-dev \
uuid-dev gawk \
gettext texinfo bcc \
libncurses5-dev dpkg-dev debhelper \
iasl texinfo bridge-utils bison flex
apt-get build-dep xen-3.3

Extract Xen 4.0.1 archive :-

cd /usr/src
gunzip xen-4.0.1.tar.gz
tar -xvf xen-4.0.1.tar
cd xen-4.0.1

Apply following patch to xen-4.0.1 folder

--- .orig/tools/hotplug/Linux/xen-backend.rules 2010-10-05 14:08:56.436012895 +0400
+++ /tools/hotplug/Linux/xen-backend.rules 2010-10-05 11:48:38.694087211 +0400
@@ -9,3 +9,5 @@
KERNEL=="evtchn", NAME="xen/%k"
KERNEL=="blktap[0-9]*", NAME="xen/%k"
KERNEL=="pci_iomul", NAME="xen/%k"
+KERNEL=="gntdev", NAME="xen/%k"
+KERNELS=="xen", KERNEL=="xvd*", SUBSYSTEM=="block", OPTIONS+="last_rule"

At this point create grub2-fix.patch1 as raw content of http://xenbits.xensource.com/xen-unstable.hg?rev/6eaab8297681 Changeset 22238 pygrub: support grub2 “(hdX,msdosY)” partition syntax

patch -p1 -s -i ../grub2-fix.patch1
make xen
make tools
make install-xen
make install-tools PYTHON_PREFIX_ARG=

Set up xend,xendomains to run as services

update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20

Create new Grub Entry and reboot into Xen environment :-

menuentry "Xen 4.0.1 / Ubuntu 10.10 kernel 2.6.34.7-0.3-xen" {
insmod ext2
set root='(hd1,9)'
multiboot (hd1,9)/xen.gz dummy=dummy dom0_mem=1024M
module (hd1,9)/vmlinuz-2.6.34.7-0.3-xen dummy=dummy root=/dev/sdb10 ro console=tty0
module (hd1,9)/initrd.img-2.6.34.7-0.3-xen
}



root@boris-System-P5Q3:~# xm info
host : boris-System-P5Q3
release : 2.6.34.7-0.3-xen
version : #1 SMP Sun Oct 17 16:22:51 MSD 2010
machine : x86_64
nr_cpus : 4
nr_nodes : 1
cores_per_socket : 4
threads_per_core : 1
cpu_mhz : 2833
hw_caps : bfebfbff:20100800:00000000:00000940:0408e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8190
free_memory : 7083
node_to_cpu : node0:0-3
node_to_memory : node0:7083
node_to_dma32_mem : node0:3259
max_node_id : 0
xen_major : 4
xen_minor : 0
xen_extra : .1
xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler : credit
xen_pagesize : 4096
platform_params : virt_start=0xffff800000000000
xen_changeset : unavailable
xen_commandline : dummy=dummy dom0_mem=1024M
cc_compiler : gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
cc_compile_by : root
cc_compile_domain :
cc_compile_date : Fri Oct 15 10:17:36 MSD 2010
xend_config_format : 4

root@boris-System-P5Q3:~# virsh version
Compiled against library: libvir 0.8.3
Using library: libvir 0.8.3
Using API: Xen 3.0.1
Running hypervisor: Xen 4.0.0



References
1. Set up Xen 4.0.1 & Libvirt 0.8.3 on top of Ubuntu 10.10 Desktop
2. http://lists.xensource.com/archives/html/xen-users/2010-09/msg00394.html


Set up Xen 4.0.1 & Libvirt 0.8.3 on top of Ubuntu 10.10 Desktop

October 15, 2010

Following bellow is brief instruction of mentioned set up loading xen back-end, evtchn, gntdev devices separately from pvops kernel 2.6.32.24 under Xen 4.0.1 on top Ubuntu Maverick Meerkat Desktop. Due to Desktop environment we have first to disable Network Manager and restart networking manually updating /etc/network/interfaces. This step is not required on the Ubuntu 10.10 Server. Libvirt 0.8.3 is available via Maverick Meerkat repositories. Two patches have been applied to official 4.0.1 tar’s ball. First one updates xen back-end rules, second one allows to load Ubuntu 10.10 PV Guest via standard trick with install same HVM first and using a ready image to load PV DomU via pygrub.

Disable Network manager

# chkconfig network-manager off
# gedit /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Restart netwoking :-

# /etc/init.d/networking restart

Install required packages

apt-get install libcurl4-openssl-dev \
xserver-xorg-dev \
mercurial gitk \
build-essential \
libncurses5-dev \
uuid-dev gawk \
gettext texinfo bcc \
libncurses5-dev dpkg-dev debhelper \
iasl texinfo bridge-utils bison flex
apt-get build-dep xen-3.3

Now git clone and checkout branch xen/stable

cd /usr/src
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git linux-2.6-xen
cd linux-2.6-xen
git checkout -b xen/stable-2.6.32.x origin/xen/stable-2.6.32.x

Build kernel in Debian way



Get .config file

aptitude install kernel-package fakeroot
export CONCURRENCY_LEVEL=(number_of_cores) +1
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-pv kernel-image kernel-headers
dpkg -i ../linux-image-2.6.32.24-pv_2.6.32.24-pv-10.00.Custom_amd64.deb

Edit /etc/modules

root@boris-System-P5Q3:~# cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
lp
rtc
xen-evtchn
xen-gntdev
xen-netback
xen-blkback
xenfs
blktap

Extract Xen 4.0.1 archive :-

cd /usr/src
gunzip xen-4.0.1.tar.gz
tar -xvf xen-4.0.1.tar
cd xen-4.0.1

Apply following patch to xen-4.0.1 folder

--- .orig/tools/hotplug/Linux/xen-backend.rules 2010-10-05 14:08:56.436012895 +0400
+++ /tools/hotplug/Linux/xen-backend.rules 2010-10-05 11:48:38.694087211 +0400
@@ -9,3 +9,5 @@
KERNEL=="evtchn", NAME="xen/%k"
KERNEL=="blktap[0-9]*", NAME="xen/%k"
KERNEL=="pci_iomul", NAME="xen/%k"
+KERNEL=="gntdev", NAME="xen/%k"
+KERNELS=="xen", KERNEL=="xvd*", SUBSYSTEM=="block", OPTIONS+="last_rule"

At this point create grub2-fix.patch1 as raw content of http://xenbits.xensource.com/xen-unstable.hg?rev/6eaab8297681 Changeset 22238 pygrub: support grub2 “(hdX,msdosY)” partition syntax

patch -p1 -s -i ../grub2-fix.patch1
make xen
make tools
make install-xen
make install-tools PYTHON_PREFIX_ARG=

Set up xend,xendomains to run as services

update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20

Reboot in Xen with grub entry

menuentry "Xen 4.0.1 / Ubuntu 10.10 kernel 2.6.32.24" {
insmod ext2
set root='(hd1,5)'
multiboot (hd1,5)/boot/xen.gz dummy=dummy dom0_mem=1024M
module (hd1,5)/boot/vmlinuz-2.6.32.24-pv dummy=dummy root=/dev/sdb5 ro console=tty0
module (hd1,5)/boot/initrd.img-2.6.32.24-pv
}

Verify Xen environment :-

root@boris-System-P5Q3:~# xm info
host : boris-System-P5Q3
release : 2.6.32.24-pv
version : #1 SMP Thu Oct 14 20:47:56 MSD 2010
machine : x86_64
nr_cpus : 4
nr_nodes : 1
cores_per_socket : 4
threads_per_core : 1
cpu_mhz : 2833
hw_caps : bfebfbff:20100800:00000000:00000940:0408e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8190
free_memory : 7070
node_to_cpu : node0:0-3
node_to_memory : node0:7070
node_to_dma32_mem : node0:3259
max_node_id : 0
xen_major : 4
xen_minor : 0
xen_extra : .1
xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler : credit
xen_pagesize : 4096
platform_params : virt_start=0xffff800000000000
xen_changeset : unavailable
xen_commandline : dummy=dummy dom0_mem=1024M
cc_compiler : gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
cc_compile_by : root
cc_compile_domain :
cc_compile_date : Fri Oct 15 10:17:36 MSD 2010
xend_config_format : 4

root@boris-System-P5Q3:~# brctl show
bridge name bridge id STP enabled interfaces
eth0 8000.90e6ba2d11eb no peth0
virbr0 8000.000000000000 yes

Install libvirt 0.8.3 :-

# apt-get install virtinst python-libvirt \
virt-viewer virt-manager

Comment out (xend-unix-server yes) in /etc/xen/xend-config.sxp and export variable VIRSH_DEFAULT_CONNECT_URI via root’s .bashrc

export VIRSH_DEFAULT_CONNECT_URI="xen:///"

Then reboot Xen Host.

root@boris-System-P5Q3:~# virsh version

Compiled against library: libvir 0.8.3
Using library: libvir 0.8.3
Using API: Xen 3.0.1
Running hypervisor: Xen 4.0.0





References
1.http://wiki.xen.org/xenwiki/Xen4.0
Tutorials to install Xen 4.0
* Xen 4.0 on Ubuntu 10.04: https://bderzhavets.wordpress.com/2010/04/24/set-up-ubuntu-10-04-server-pv-domu-at-xen-4-0-dom0-pvops-2-6-32-10-kernel-dom0-on-top-of-ubuntu-10-04-server/


Configuring Xen 4.0.1 & 2.6.32.23 pvops kernel for stable networking with OpenIndiana/OpenSolaris PV Guests on top of Ubuntu 10.04.1 Server

October 5, 2010

This post is targeting pvops kernel 2.6.32.23 configuration close to 2.6.34.7 aka Suse 11.3 Xenified kernel. This config by some reasons allows OpenSolaris134/OpenIndiana147 PV Guest obtain IP address pretty stable on systems Xen 4.0.1 & PVOPS like it happens on OpenSuse 11.3 with Xen Hypervisor upgraded up to 4.0.1 and the most recent XenLinux 2.6.34.7 kernel. PVOPS systems with mentioned bellow drivers hard linked to the kernel have permanent trouble with providing
IP via DHCP request,issued by OSOL/OI_147 PV guest, to this guest at least through my experience. Actually , only xen-netback module loaded separately from kernel is important. I just tried to change traditional PVOPS config , working perfectly for Linux guests, a bit more then usual and see what happens. The last step obviously requires changing xen-backend.rules. Testing has been done on top of Ubuntu 10.04.1 Server. On Fedoras 13,14 in case of using Michael Young’s Dom0 kernel and xen-4.0.1 via Fedora repos there is nothing to wary about, in case of git checkout via Jeremy Fitzhardinge repository you are responsible for .config tuning 2.6.32.23 pvops kernel.

Apply following patch to xen-4.0.1 folder

--- .orig/tools/hotplug/Linux/xen-backend.rules 2010-10-05 14:08:56.436012895 +0400
+++ /tools/hotplug/Linux/xen-backend.rules 2010-10-05 11:48:38.694087211 +0400
@@ -9,3 +9,5 @@
KERNEL=="evtchn", NAME="xen/%k"
KERNEL=="blktap[0-9]*", NAME="xen/%k"
KERNEL=="pci_iomul", NAME="xen/%k"
+KERNEL=="gntdev", NAME="xen/%k"
+KERNELS=="xen", KERNEL=="xvd*", SUBSYSTEM=="block", OPTIONS+="last_rule"

Rebuild and reinstall xen and tools
Change standard tuning of pvops kernel as follows:-

CONFIG_XEN_BALLOON=y
CONFIG_XEN_SCRUB_PAGES=y
CONFIG_XEN_DEV_EVTCHN=m
CONFIG_XEN_BACKEND=y
CONFIG_XEN_NETDEV_BACKEND=m
CONFIG_XEN_BLKDEV_BACKEND=m
CONFIG_XEN_BLKDEV_TAP=m
CONFIG_XEN_BLKBACK_PAGEMAP=m
CONFIG_XEN_PCIDEV_BACKEND=y
CONFIG_XEN_PCIDEV_BACKEND_VPCI=y
# CONFIG_XEN_PCIDEV_BACKEND_PASS is not set
# CONFIG_XEN_PCIDEV_BACKEND_SLOT is not set
# CONFIG_XEN_PCIDEV_BACKEND_CONTROLLER is not set
CONFIG_XEN_PCIDEV_BE_DEBUG=y
CONFIG_XENFS=m
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_MCE=y
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_GNTDEV=m

Build and install

cd /usr/src/linux-2.6-xen
aptitude install kernel-package fakeroot
export CONCURRENCY_LEVEL=(number_of_cores) +1
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-pv kernel-image kernel-headers
dpkg -i ../linux-image-2.6.32.23-pv_2.6.32.23-pv-10.00.Custom_amd64.deb



Apply following patch to /etc/init.d/xend

--- xend.orig 2010-10-06 18:44:35.055245544 +0400
+++ xend 2010-10-06 18:46:26.056620024 +0400
@@ -21,7 +21,7 @@

shopt -s extglob
test -f /etc/sysconfig/xend && . /etc/sysconfig/xend
-
+/sbin/modprobe -v xenfs
if test "x$1" = xstart && \
test -d /proc/xen && \
! test -d /proc/xen/capabilities && \
@@ -57,6 +57,11 @@
test -z "$XENCONSOLED_TRACE" || export XENCONSOLED_TRACE
[[ "$XENSTORED_TRACE" == @(yes|on|1) ]] && export XENSTORED_TRACE
[[ "$XENBACKENDD_DEBUG" == @(yes|on|1) ]] && export XENBACKENDD_DEBUG
+ /sbin/modprobe -v xen-evtchn
+ /sbin/modprobe -v xen-gntdev
+ /sbin/modprobe -v xen-blkback
+ /sbin/modprobe -v xen-netback
+ /sbin/modprobe -v blktap
xend start
await_daemons_up
;;

Another option on Ubuntu 10.04.1 Server configure /etc/modules as follows

root@ServerLLX:~# cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
loop
lp
rtc
xen-evtchn
xen-gntdev
xen-netback
xen-blkback
xenfs
blktap

Reboot the system and make sure :-

root@ServerLLX:~# ls -l /dev/xen
total 0
crw-rw---- 1 root root 10, 57 2010-10-05 13:29 evtchn
crw-rw---- 1 root root 10, 56 2010-10-05 13:29 gntdev

root@ServerLLX:~# lsmod|grep xen
xenfs 10142 1
xen_blkback 19942 0 [permanent]
blkback_pagemap 2592 2 blktap,xen_blkback
xen_netback 28778 0 [permanent]
xen_gntdev 7172 0
xen_evtchn 4806 1

root@ServerLLX:~# lsmod|grep blktap
blktap 22229 0
blkback_pagemap 2592 2 blktap,xen_blkback




I have to notice that the most recent pvops kernels 2.6.32.23,(24) don’t require patching xen-backend to create device /dev/xen/gntdev. It appears to be created automatically , even when xen-gntdev has been created as a module. However, attempt to disable xen hotplug patch affects starting domains, created by virt-manager, right away.