From: plc <plc@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] xend ioport irq persistence thru reboot
Date: Fri, 31 Oct 2008 12:16:27 -0600 [thread overview]
Message-ID: <490B4B7B.9020200@novell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 541 bytes --]
When a domU is configured for a serail port as documented at:
http://wiki.xensource.com/xenwiki/InstallationNotes
the VM does see the serial port, however when dom0 is rebooted and
the VM started it no longer has access to the serial port.
xm list -l <vm> no longer shows the ioports or irq attributes
Attached patch adds implementation of getDeviceConfiguration(), returns
details dict and implements waitForDevice() to irqif.py and iopif.py.
Also added preprocess_irq() to create.py.
Signed-off-by: Pat Campbell <plc@novell.com>
[-- Attachment #2: xend-ioport-irq.patch --]
[-- Type: text/x-patch, Size: 3626 bytes --]
diff -r 1a1271d83edf tools/python/xen/xend/server/iopif.py
--- a/tools/python/xen/xend/server/iopif.py Tue Sep 30 13:55:27 2008 -0600
+++ b/tools/python/xen/xend/server/iopif.py Thu Oct 30 14:29:12 2008 -0600
@@ -45,8 +45,21 @@ 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
diff -r 1a1271d83edf tools/python/xen/xend/server/irqif.py
--- a/tools/python/xen/xend/server/irqif.py Tue Sep 30 13:55:27 2008 -0600
+++ b/tools/python/xen/xend/server/irqif.py Fri Oct 31 12:13:01 2008 -0600
@@ -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
diff -r 1a1271d83edf tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py Tue Sep 30 13:55:27 2008 -0600
+++ b/tools/python/xen/xm/create.py Thu Oct 30 14:29:12 2008 -0600
@@ -1025,6 +1025,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 = []
@@ -1123,6 +1131,7 @@ def preprocess(vals):
preprocess_vscsi(vals)
preprocess_ioports(vals)
preprocess_ip(vals)
+ preprocess_irq(vals)
preprocess_nfs(vals)
preprocess_vtpm(vals)
preprocess_access_control(vals)
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2008-10-31 18:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=490B4B7B.9020200@novell.com \
--to=plc@novell.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.