View Issue Details

IDProjectCategoryView StatusLast Update
0002485CentOS-5xenpublic2009-11-28 00:21
Reporterhrak 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version5.1 
Target VersionFixed in Version 
Summary0002485: Xen ioport and irq mapping functionality broken in 3.0.3-41.el5
DescriptionAfter upgrading to CentOS 5.1, Xen's functionality to map i/o ports and irq's (f.e. to access a serial port in DomU) is broken.

This is due to upstream bug http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1053

The fix is simple, see attached patch for iopif.py and irqif.py.
TagsNo tags attached.

Activities

2007-12-03 13:52

 

xenpatch.diff (1,019 bytes)
--- iopif.py.orig	2007-12-03 14:47:29.000000000 +0100
+++ iopif.py	2007-12-03 14:47:29.000000000 +0100
@@ -72,7 +72,7 @@
             raise VmError('ioports: Invalid i/o range: %s - %s' %
                           (io_from, io_to))
 
-        rc = xc.domain_ioport_permission(dom          = self.getDomid(),
+        rc = xc.domain_ioport_permission(domid        = self.getDomid(),
                                          first_port   = io_from,
                                          nr_ports     = io_to - io_from + 1,
                                          allow_access = True)
--- irqif.py.orig	2007-12-03 14:47:40.000000000 +0100
+++ irqif.py	2007-12-03 14:47:40.000000000 +0100
@@ -61,7 +61,7 @@
        
         pirq = get_param('irq')
 
-        rc = xc.domain_irq_permission(dom          = self.getDomid(),
+        rc = xc.domain_irq_permission(domid        = self.getDomid(),
                                       pirq         = pirq,
                                       allow_access = True)
 
xenpatch.diff (1,019 bytes)
hrak

hrak

2007-12-04 13:48

reporter   ~0006470

Same goes for pciif.py btw, which i missed initially. This also contains 3 occurances of 'dom' on line 160, 174 and 184 which should actually be 'domid'.
mlodi72

mlodi72

2008-02-20 19:13

reporter   ~0006915

After having changed the iopif.py, irqif.py and pciif.py the problem persist.
No way to use serial port in domU.
darkfader

darkfader

2008-04-02 04:58

reporter   ~0007079

same here, problem persists after applying the patch.


Linux localhost.localdomain 2.6.18-53.1.14.el5xen #1 SMP Wed Mar 5 12:08:17 EST 2008 x86_64 x86_64 x86_64 GNU/Linux

2008-04-17 18:40

 

xen-2485.patch (3,262 bytes)
diff -Nur old/usr/lib64/python2.4/site-packages/xen/xend/server/iopif.py new/usr/lib64/python2.4/site-packages/xen/xend/server/iopif.py
--- old/usr/lib64/python2.4/site-packages/xen/xend/server/iopif.py      2008-04-17 18:23:07.705409282 +0200
+++ new/usr/lib64/python2.4/site-packages/xen/xend/server/iopif.py      2008-04-17 18:48:24.960231782 +0200
@@ -72,7 +72,7 @@
             raise VmError('ioports: Invalid i/o range: %s - %s' %
                           (io_from, io_to))

-        rc = xc.domain_ioport_permission(dom          = self.getDomid(),
+        rc = xc.domain_ioport_permission(domid        = self.getDomid(),
                                          first_port   = io_from,
                                          nr_ports     = io_to - io_from + 1,
                                          allow_access = True)
diff -Nur old/usr/lib64/python2.4/site-packages/xen/xend/server/irqif.py new/usr/lib64/python2.4/site-packages/xen/xend/server/irqif.py
--- old/usr/lib64/python2.4/site-packages/xen/xend/server/irqif.py      2008-04-17 19:12:11.305372782 +0200
+++ new/usr/lib64/python2.4/site-packages/xen/xend/server/irqif.py      2008-04-17 19:15:50.363063032 +0200
@@ -61,7 +61,7 @@

         pirq = get_param('irq')

-        rc = xc.domain_irq_permission(dom          = self.getDomid(),
+        rc = xc.domain_irq_permission(domid        = self.getDomid(),
                                       pirq         = pirq,
                                       allow_access = True)

diff -Nur old/usr/lib64/python2.4/site-packages/xen/xend/server/pciif.py new/usr/lib64/python2.4/site-packages/xen/xend/server/pciif.py
--- old/usr/lib64/python2.4/site-packages/xen/xend/server/pciif.py      2008-04-17 18:23:07.717410032 +0200
+++ new/usr/lib64/python2.4/site-packages/xen/xend/server/pciif.py      2008-04-17 18:48:24.960231782 +0200
@@ -155,9 +155,9 @@
         PCIQuirk(dev.vendor, dev.device, dev.subvendor, dev.subdevice, domain,
                 bus, slot, func)

-       for (start, size) in dev.ioports:
+        for (start, size) in dev.ioports:
             log.debug('pci: enabling ioport 0x%x/0x%x'%(start,size))
-            rc = xc.domain_ioport_permission(dom = fe_domid, first_port = start,
+            rc = xc.domain_ioport_permission(domid = fe_domid, first_port = start,
                     nr_ports = size, allow_access = True)
             if rc<0:
                 raise VmError(('pci: failed to configure I/O ports on device '+
@@ -171,7 +171,7 @@

             log.debug('pci: enabling iomem 0x%x/0x%x pfn 0x%x/0x%x'% \
                     (start,size,start_pfn,nr_pfns))
-            rc = xc.domain_iomem_permission(dom = fe_domid,
+            rc = xc.domain_iomem_permission(domid = fe_domid,
                     first_pfn = start_pfn,
                     nr_pfns = nr_pfns,
                     allow_access = True)
@@ -181,7 +181,7 @@

         if dev.irq>0:
             log.debug('pci: enabling irq %d'%dev.irq)
-            rc = xc.domain_irq_permission(dom = fe_domid, pirq = dev.irq,
+            rc = xc.domain_irq_permission(domid = fe_domid, pirq = dev.irq,
                     allow_access = True)
             if rc<0:
                 raise VmError(('pci: failed to configure irq on device '+
xen-2485.patch (3,262 bytes)
andree

andree

2008-04-17 18:43

reporter   ~0007146

After applying xen-2485.patch on latest packages of centos 5.1 problem has been solved.
wolfy

wolfy

2009-11-28 00:21

developer   ~0010424

xen-2485.patch seems to be applied xen-3.0.3-94.el5_4.2 (maybe earlier, but this is the version that I have at hand).
I guess we could/should close the bug ?

Issue History

Date Modified Username Field Change
2007-12-03 13:52 hrak New Issue
2007-12-03 13:52 hrak File Added: xenpatch.diff
2007-12-04 13:48 hrak Note Added: 0006470
2008-02-20 19:13 mlodi72 Note Added: 0006915
2008-04-02 04:58 darkfader Note Added: 0007079
2008-04-17 18:40 andree File Added: xen-2485.patch
2008-04-17 18:43 andree Note Added: 0007146
2009-11-28 00:21 wolfy Note Added: 0010424