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-changelog

[Xen-changelog] [xen-unstable] xend: pass-through: tidy up PciController

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: pass-through: tidy up PciController()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Jun 2009 00:55:23 -0700
Delivery-date: Fri, 19 Jun 2009 00:57:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1245148563 -3600
# Node ID dce4d6840db1283bfa155d7ce6b82930c528f36f
# Parent  08de8ec655c2361a4cb68590cfa2ce2762f7c55e
xend: pass-through: tidy up PciController()

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
 tools/python/xen/xend/server/pciif.py |   41 +++++++++++++---------------------
 1 files changed, 16 insertions(+), 25 deletions(-)

diff -r 08de8ec655c2 -r dce4d6840db1 tools/python/xen/xend/server/pciif.py
--- a/tools/python/xen/xend/server/pciif.py     Tue Jun 16 11:35:16 2009 +0100
+++ b/tools/python/xen/xend/server/pciif.py     Tue Jun 16 11:36:03 2009 +0100
@@ -540,33 +540,24 @@ class PciController(DevController):
                 # In HVM case, I/O resources are disabled in ioemu.
                 self.cleanupOneDevice(domain, bus, slot, func)
                 # Remove xenstore nodes.
-                self.removeBackend(devid, 'dev-%i' % i)
-                self.removeBackend(devid, 'vdev-%i' % i)
-                self.removeBackend(devid, 'state-%i' % i)
-                self.removeBackend(devid, 'uuid-%i' % i)
-                tmpopts = self.readBackend(devid, 'opts-%i' % i)
-                if tmpopts is not None:
-                    self.removeBackend(devid, 'opts-%i' % i)
+                list = ['dev', 'vdev', 'state', 'uuid']
+                if self.readBackend(devid, 'opts-%i' % i) is not None:
+                    list.append('opts')
+                for key in list:
+                    self.removeBackend(devid, '%s-%i' % (key, i))
             else:
-                if new_num_devs != i:
-                    tmpdev = self.readBackend(devid, 'dev-%i' % i)
-                    self.writeBackend(devid, 'dev-%i' % new_num_devs, tmpdev)
-                    self.removeBackend(devid, 'dev-%i' % i)
-                    tmpvdev = self.readBackend(devid, 'vdev-%i' % i)
-                    if tmpvdev is not None:
-                        self.writeBackend(devid, 'vdev-%i' % new_num_devs,
-                                          tmpvdev)
-                    self.removeBackend(devid, 'vdev-%i' % i)
-                    tmpstate = self.readBackend(devid, 'state-%i' % i)
-                    self.writeBackend(devid, 'state-%i' % new_num_devs, 
tmpstate)
-                    self.removeBackend(devid, 'state-%i' % i)
-                    tmpuuid = self.readBackend(devid, 'uuid-%i' % i)
-                    self.writeBackend(devid, 'uuid-%i' % new_num_devs, tmpuuid)
-                    self.removeBackend(devid, 'uuid-%i' % i)
-                    tmpopts = self.readBackend(devid, 'opts-%i' % i)
-                    if tmpopts is not None:
-                        self.removeBackend(devid, 'opts-%i' % i)
                 new_num_devs = new_num_devs + 1
+                if new_num_devs == i + 1:
+                    continue
+
+                list = ['dev', 'vdev', 'state', 'uuid', 'opts']
+                for key in list:
+                    tmp = self.readBackend(devid, '%s-%i' % (key, i))
+                    if tmp is None:
+                        continue
+                    self.removeBackend(devid, '%s-%i' % (key, i))
+                    self.writeBackend(devid,
+                                      '%s-%i' % (key, new_num_devs - 1), tmp)
 
         self.writeBackend(devid, 'num_devs', str(new_num_devs))
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: pass-through: tidy up PciController(), Xen patchbot-unstable <=