File 18745-xend-ioport-irq.patch of Package xen

Index: xen-3.3.1-testing/tools/python/xen/xend/server/iopif.py
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/xend/server/iopif.py
+++ xen-3.3.1-testing/tools/python/xen/xend/server/iopif.py
@@ -45,9 +45,22 @@ def parse_ioport(val):
 
 class IOPortsController(DevController):
 
+    valid_cfg = ['to', 'from', 'uuid']
+
     def __init__(self, vm):
         DevController.__init__(self, vm)
 
+    def getDeviceConfiguration(self, devid, transaction = None):
+        result = DevController.getDeviceConfiguration(self, devid, transaction)
+        if transaction is None:
+            devinfo = self.readBackend(devid, *self.valid_cfg)
+        else:
+            devinfo = self.readBackendTxn(transaction, devid, *self.valid_cfg)
+        config = dict(zip(self.valid_cfg, devinfo))
+        config = dict([(key, val) for key, val in config.items()
+                       if val != None])
+        return config
+
     def getDeviceDetails(self, config):
         """@see DevController.getDeviceDetails"""
 
@@ -81,4 +94,9 @@ class IOPortsController(DevController):
                 'ioports: Failed to configure legacy i/o range: %s - %s' %
                 (io_from, io_to))
 
-        return (None, {}, {})
+        back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
+        return (self.allocateDeviceID(), back, {})
+
+    def waitForDevice(self, devid):
+        # don't wait for hotplug
+        return
Index: xen-3.3.1-testing/tools/python/xen/xend/server/irqif.py
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/xend/server/irqif.py
+++ xen-3.3.1-testing/tools/python/xen/xend/server/irqif.py
@@ -39,6 +39,18 @@ class IRQController(DevController):
     def __init__(self, vm):
         DevController.__init__(self, vm)
 
+    valid_cfg = ['irq', 'uuid']
+
+    def getDeviceConfiguration(self, devid, transaction = None):
+        result = DevController.getDeviceConfiguration(self, devid, transaction)
+        if transaction is None:
+            devinfo = self.readBackend(devid, *self.valid_cfg)
+        else:
+            devinfo = self.readBackendTxn(transaction, devid, *self.valid_cfg)
+        config = dict(zip(self.valid_cfg, devinfo))
+        config = dict([(key, val) for key, val in config.items()
+                       if val != None])
+        return config
 
     def getDeviceDetails(self, config):
         """@see DevController.getDeviceDetails"""
@@ -75,4 +87,9 @@ class IRQController(DevController):
         if rc < 0:
             raise VmError(
                 'irq: Failed to map irq %x' % (pirq))
-        return (None, {}, {})
+        back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
+        return (self.allocateDeviceID(), back, {})
+
+    def waitForDevice(self, devid):
+        # don't wait for hotplug
+        return
Index: xen-3.3.1-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.3.1-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.3.1-testing/tools/python/xen/xm/create.py
@@ -1032,6 +1032,14 @@ def preprocess_ioports(vals):
         ioports.append(hexd)
     vals.ioports = ioports
         
+def preprocess_irq(vals):
+    if not vals.irq: return
+    irq = []
+    for v in vals.irq:
+        d = repr(v)
+        irq.append(d)
+    vals.irq = irq
+
 def preprocess_vtpm(vals):
     if not vals.vtpm: return
     vtpms = []
@@ -1162,6 +1170,7 @@ def preprocess(vals):
     preprocess_vscsi(vals)
     preprocess_ioports(vals)
     preprocess_ip(vals)
+    preprocess_irq(vals)
     preprocess_nfs(vals)
     preprocess_vnc(vals)
     preprocess_vtpm(vals)
openSUSE Build Service is sponsored by