[xen] Various bug fixes, tidy ups and startup script tweaks

myoung myoung at fedoraproject.org
Mon Nov 21 16:18:31 UTC 2011


commit fbce2febebb5f29cbf7cd312fec2b4855aedd2ba
Author: Michael Young <m.a.young at durham.ac.uk>
Date:   Mon Nov 21 16:17:33 2011 +0000

    Various bug fixes, tidy ups and startup script tweaks

 blktapctrl.service          |   15 ++++++++++
 dom0-kernel.repo            |   11 -------
 xen-4.1-testing.23190.patch |   64 +++++++++++++++++++++++++++++++++++++++++++
 xen.spec                    |   32 +++++++++++++--------
 xend.catchbt.patch          |   15 ++++++++++
 xend.empty.xml.patch        |   15 ++++++++++
 6 files changed, 129 insertions(+), 23 deletions(-)
---
diff --git a/blktapctrl.service b/blktapctrl.service
new file mode 100644
index 0000000..787053c
--- /dev/null
+++ b/blktapctrl.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=blktapctrl daemon
+Requires=proc-xen.mount
+After=proc-xen.mount
+RefuseManualStop=true
+
+[Service]
+Type=forking
+Environment=BLKTAPCTRL_ARGS=
+EnvironmentFile=-/etc/sysconfig/blktapctrl
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStart=/usr/sbin/blktapctrl $BLKTAPCTRL_ARGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/xen-4.1-testing.23190.patch b/xen-4.1-testing.23190.patch
new file mode 100644
index 0000000..2c51bc8
--- /dev/null
+++ b/xen-4.1-testing.23190.patch
@@ -0,0 +1,64 @@
+
+# HG changeset patch
+# User Stefano Stabellini <stefano.stabellini at eu.citrix.com>
+# Date 1321623485 0
+# Node ID 5a00ccfc63915650b8e1a262c2cad8e8d8670612
+# Parent  e73ada19a69daf821aa7d80323f1bd76239b9bae
+x86: re-inject emulated level pirqs in PV on HVM guests if still asserted
+
+PV on HVM guests can loose level interrupts coming from emulated
+devices if they have been remapped onto event channels.  The reason is
+that we are missing the code to inject a pirq again in the guest when
+the guest EOIs it, if it corresponds to an emulated level interrupt
+and the interrupt is still asserted.
+
+Fix this issue and also return error when the guest tries to get the
+irq_status of a non-existing pirq.
+
+
+Changes in this backport:
+ - move the spinlock afterward to cover the new code only.
+
+Signed-off-by: Stefano Stabellini <stefano.stabellini at eu.citrix.com>
+Committed-by: Keir Fraser <keir at xen.org>
+xen-unstable changeset:   24007:0526644ad2a6
+xen-unstable date:        Thu Oct 27 16:07:18 2011 +0100
+
+diff -r e73ada19a69d -r 5a00ccfc6391 xen/arch/x86/physdev.c
+--- a/xen/arch/x86/physdev.c	Thu Nov 17 09:13:25 2011 +0000
++++ b/xen/arch/x86/physdev.c	Fri Nov 18 13:38:05 2011 +0000
+@@ -268,6 +268,20 @@
+             ret = pirq_guest_eoi(v->domain, eoi.irq);
+         else
+             ret = 0;
++        spin_lock(&v->domain->event_lock);
++        if ( is_hvm_domain(v->domain) &&
++                domain_pirq_to_emuirq(v->domain, eoi.irq) > 0 )
++        {
++            struct hvm_irq *hvm_irq = &v->domain->arch.hvm_domain.irq;
++            int gsi = domain_pirq_to_emuirq(v->domain, eoi.irq);
++
++            /* if this is a level irq and count > 0, send another
++             * notification */ 
++            if ( gsi >= NR_ISAIRQS /* ISA irqs are edge triggered */
++                    && hvm_irq->gsi_assert_count[gsi] )
++                send_guest_pirq(v->domain, eoi.irq);
++        }
++        spin_unlock(&v->domain->event_lock);
+         break;
+     }
+ 
+@@ -323,9 +337,10 @@
+             break;
+         irq_status_query.flags = 0;
+         if ( is_hvm_domain(v->domain) &&
+-             domain_pirq_to_irq(v->domain, irq) <= 0 )
++                domain_pirq_to_irq(v->domain, irq) <= 0 &&
++                domain_pirq_to_emuirq(v->domain, irq) == IRQ_UNBOUND )
+         {
+-            ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
++            ret = -EINVAL;
+             break;
+         }
+ 
+
diff --git a/xen.spec b/xen.spec
index 0c6930e..d925d12 100644
--- a/xen.spec
+++ b/xen.spec
@@ -6,14 +6,13 @@
 Summary: Xen is a virtual machine monitor
 Name:    xen
 Version: 4.1.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group:   Development/Libraries
 License: GPLv2+ and LGPLv2+ and BSD
 URL:     http://xen.org/
 Source0: http://bits.xensource.com/oss-xen/release/%{version}/xen-%{version}.tar.gz
 Source1: %{name}.modules
 Source2: %{name}.logrotate
-Source3: dom0-kernel.repo
 # used by stubdoms
 Source10: lwip-1.3.0.tar.gz
 Source11: newlib-1.16.0.tar.gz
@@ -34,6 +33,7 @@ Source32: sysconfig.blktapctrl
 Source40: proc-xen.mount
 Source41: var-lib-xenstored.mount
 Source42: xenstored.service
+Source43: blktapctrl.service
 
 Patch1: xen-initscript.patch
 Patch4: xen-dumpdir.patch
@@ -47,6 +47,9 @@ Patch23: grub-ext4-support.patch
 Patch26: localgcc46fix.patch
 Patch28: pygrubfix.patch
 Patch31: pygrubfix2.patch
+Patch32: xen-4.1-testing.23190.patch
+Patch33: xend.empty.xml.patch
+Patch34: xend.catchbt.patch
 
 Patch100: xen-configure-xend.patch
 
@@ -173,6 +176,9 @@ to build the xen packages.
 %patch26 -p1
 %patch28 -p1
 %patch31 -p1
+%patch32 -p1
+%patch33 -p1
+%patch34 -p1
 
 %patch100 -p1
 
@@ -274,6 +280,7 @@ mkdir -p %{buildroot}/lib/systemd/system
 install -m 644 %{SOURCE40} %{buildroot}/lib/systemd/system/proc-xen.mount
 install -m 644 %{SOURCE41} %{buildroot}/lib/systemd/system/var-lib-xenstored.mount
 install -m 644 %{SOURCE42} %{buildroot}/lib/systemd/system/xenstored.service
+install -m 644 %{SOURCE43} %{buildroot}/lib/systemd/system/blktapctrl.service
 
 # config file only used for hotplug, Fedora uses udev instead
 rm -f %{buildroot}/%{_sysconfdir}/sysconfig/xend
@@ -286,11 +293,6 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/xen/xend-db/migrate
 mkdir -p %{buildroot}%{_localstatedir}/lib/xen/images
 mkdir -p %{buildroot}%{_localstatedir}/log/xen/console
 
-############ add pointer to kernels ############
-
-mkdir -p %{buildroot}%{_sysconfdir}/yum.repos.d
-cp %{SOURCE3} %{buildroot}%{_sysconfdir}/yum.repos.d
-
 ############ create symlink for x86_64 for compatibility with 3.4 ############
 
 %if "%{_libdir}" != "/usr/lib"
@@ -351,12 +353,12 @@ fi
 %postun libs -p /sbin/ldconfig
 
 %post hypervisor
-if [ -f /sbin/grub2-mkconfig -a -f /boot/grub2/grub.cfg ]; then
+if [ $1 = 1 -a -f /sbin/grub2-mkconfig -a -f /boot/grub2/grub.cfg ]; then
   /sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
 fi
 
 %postun hypervisor
-if [ $1 = 0 -a -f /sbin/grub2-mkconfig -a -f /boot/grub2/grub.cfg ]; then
+if [ -f /sbin/grub2-mkconfig -a -f /boot/grub2/grub.cfg ]; then
   /sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
 fi
 
@@ -398,9 +400,6 @@ rm -rf %{buildroot}
 %dir %{_localstatedir}/lib/%{name}/xend-db/migrate
 %dir %{_localstatedir}/lib/%{name}/xend-db/vnet
 
-# pointer to dom0 kernel
-%config(noreplace) %{_sysconfdir}/yum.repos.d/dom0-kernel.repo
-
 %files libs
 %defattr(-,root,root)
 %{_libdir}/*.so.*
@@ -426,6 +425,7 @@ rm -rf %{buildroot}
 /lib/systemd/system/proc-xen.mount
 /lib/systemd/system/var-lib-xenstored.mount
 /lib/systemd/system/xenstored.service
+/lib/systemd/system/blktapctrl.service
 
 %config(noreplace) %{_sysconfdir}/sysconfig/xenstored
 %config(noreplace) %{_sysconfdir}/sysconfig/xenconsoled
@@ -560,6 +560,14 @@ rm -rf %{buildroot}
 %doc licensedir/*
 
 %changelog
+* Mon Nov 21 2011 Michael Young <m.a.young at durham.ac.uk> - 4.1.2-2
+- Fix lost interrupts on emulated devices
+- stop xend crashing if its state files are empty at start up
+- avoid a python backtrace if xend is run on bare metal
+- update grub2 configuration after the old hypervisor has gone
+- move blktapctrl to systemd
+- Drop obsolete dom0-kernel.repo file
+
 * Fri Oct 21 2011 Michael Young <m.a.young at durham.ac.uk> - 4.1.2-1
 - update to 4.1.2
   remove upstream patches xen-4.1-testing.23104 and xen-4.1-testing.23112
diff --git a/xend.catchbt.patch b/xend.catchbt.patch
new file mode 100644
index 0000000..8215839
--- /dev/null
+++ b/xend.catchbt.patch
@@ -0,0 +1,15 @@
+--- xen-4.1.2/tools/python/xen/xend/image.py.orig	2011-10-20 18:05:44.000000000 +0100
++++ xen-4.1.2/tools/python/xen/xend/image.py	2011-11-20 20:41:10.730905790 +0000
+@@ -43,7 +43,11 @@
+ from xen.util import utils
+ from xen.xend import osdep
+ 
+-xc = xen.lowlevel.xc.xc()
++try:
++    xc = xen.lowlevel.xc.xc()
++except Exception:
++    print >>sys.stderr, ('xend/image.py: Error connecting to hypervisor')
++    os._exit(1)
+ 
+ MAX_GUEST_CMDLINE = 1024
+ 
diff --git a/xend.empty.xml.patch b/xend.empty.xml.patch
new file mode 100644
index 0000000..e3f29d3
--- /dev/null
+++ b/xend.empty.xml.patch
@@ -0,0 +1,15 @@
+http://lists.xensource.com/archives/html/xen-devel/2011-11/msg00218.html
+
+diff -r 54a5e994a241 -r 76391f599433 tools/python/xen/xend/XendStateStore.py
+--- a/tools/python/xen/xend/XendStateStore.py   Wed Nov 02 17:09:09 2011 +0000
++++ b/tools/python/xen/xend/XendStateStore.py   Thu Nov 03 12:02:44 2011 -0400
+@@ -101,6 +101,9 @@ class XendStateStore:
+         if not os.path.exists(xml_path):
+             return {}
+ 
++        if not os.path.getsize(xml_path) == 0:
++            return {}
++
+         dom = minidom.parse(xml_path)
+         root = dom.documentElement
+         state = {}


More information about the scm-commits mailing list