WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [patch] xend: pass-through: device state in xenstore may be

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [patch] xend: pass-through: device state in xenstore may be null
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Mon, 27 Jul 2009 19:35:46 +1000
Cc: Tom Rotenberg <tom.rotenberg@xxxxxxxxx>
Delivery-date: Mon, 27 Jul 2009 02:36:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
From: Tom Rotenberg <tom.rotenberg@xxxxxxxxx>

This patch was proposed by Tom Rotenberg to fix a bug that he found.

After devices are inserted into xenstore using _createDevices()
they may not have a state entry. This is a problem for cleanupDevices()
which is called when PCI devices are passed-through.

This patch seems to be correct as with it applied cleanupDevices() simply
ignores the state if it is unknown.

The confusing part about this problem is that on Tom's system devices don't
have state entries and on my system they have have state=3 (Initialised).
The latter seems to be wrong.

Error Log:

Traceback (most recent call last):
  File "usr/lib/python2.5/site-packages/xen/xend/XendDomainInfo.py", line 99, 
in create
    vm.start()
  File "usr/lib/python2.5/site-packages/xen/xend/XendDomainInfo.py", line 459, 
in start
    XendTask.log_progress(31, 60, self._initDomain)
  File "usr/lib/python2.5/site-packages/xen/xend/XendTask.py", line 209, in 
log_progress
    retval = func(*args, **kwds)
  File "usr/lib/python2.5/site-packages/xen/xend/XendDomainInfo.py", line 2544, 
in _initDomain
    self._createDevices()
  File "usr/lib/python2.5/site-packages/xen/xend/XendDomainInfo.py", line 2170, 
in _createDevices
    self.pci_device_configure_boot()
  File "usr/lib/python2.5/site-packages/xen/xend/XendDomainInfo.py", line 594, 
in pci_device_configure_boot
    self.pci_device_configure(dev_sxp)
  File "usr/lib/python2.5/site-packages/xen/xend/XendDomainInfo.py", line 876, 
in pci_device_configure
    num_devs = dev_control.cleanupDevice(devid)
  File "usr/lib/python2.5/site-packages/xen/xend/server/pciif.py", line 502, in 
cleanupDevice
    state = int(self.readBackend(devid, 'state-%i' % i))
TypeError: int() argument must be a string or a number, not 'NoneType'

Cc: Tom Rotenberg <tom.rotenberg@xxxxxxxxx>
Signed-off-by: Tom Rotenberg <tom.rotenberg@xxxxxxxxx>

--- 

This patch is applicable to the pass-through backport to xen-3.4-testing.
Accordingly I have pushed it to the following trees:

* http://hg.vergenet.net/xen/xen-3.4-testing-pass-through-multi-function/
* http://hg.vergenet.net/xen/xen-3.4-testing-pass-through/

It is also applicable to xen-unstable.hg.

Index: xen-unstable.hg/tools/python/xen/xend/server/pciif.py
===================================================================
--- xen-unstable.hg.orig/tools/python/xen/xend/server/pciif.py  2009-07-14 
15:12:46.000000000 +1000
+++ xen-unstable.hg/tools/python/xen/xend/server/pciif.py       2009-07-27 
18:55:14.000000000 +1000
@@ -489,7 +489,11 @@ class PciController(DevController):
         num_devs = int(self.readBackend(devid, 'num_devs'))
         new_num_devs = 0
         for i in range(num_devs):
-            state = int(self.readBackend(devid, 'state-%i' % i))
+            try:
+                state = int(self.readBackend(devid, 'state-%i' % i))
+            except:
+                state = xenbusState['Unknown']
+
             if state == xenbusState['Closing']:
                 # Detach I/O resources.
                 pci_dev = parse_pci_name(self.readBackend(devid, 'dev-%i' % i))

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [patch] xend: pass-through: device state in xenstore may be null, Simon Horman <=