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-4.0-testing] Remus: include device name in vif obje

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] Remus: include device name in vif objects
From: "Xen patchbot-4.0-testing" <patchbot-4.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Jun 2010 23:35:30 -0700
Delivery-date: Mon, 21 Jun 2010 23:36:59 -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 1277188166 -3600
# Node ID 1d09d8eecc3aa002d51a9ffd0bc5c1bd0ce67ad3
# Parent  b075559944d1afc9c39816a1b7924e5d1b87a5de
Remus: include device name in vif objects

Signed-off-by: Brendan Cully <brendan@xxxxxxxxx>
xen-unstable changeset:   21242:e1482f91b235
xen-unstable date:        Tue May 04 09:35:18 2010 +0100
---
 tools/python/xen/remus/vif.py |    8 ++++++--
 tools/python/xen/remus/vm.py  |    8 +++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff -r b075559944d1 -r 1d09d8eecc3a tools/python/xen/remus/vif.py
--- a/tools/python/xen/remus/vif.py     Tue Jun 22 07:28:47 2010 +0100
+++ b/tools/python/xen/remus/vif.py     Tue Jun 22 07:29:26 2010 +0100
@@ -2,6 +2,7 @@ from xen.remus.util import canonifymac
 
 class VIF(object):
     def __init__(self, **props):
+        self.dev = 'unknown'
         self.__dict__.update(props)
         if 'mac' in props:
             self.mac = canonifymac(props['mac'])
@@ -9,6 +10,9 @@ class VIF(object):
     def __str__(self):
         return self.mac
 
-def parse(props):
+def parse(props, domid, index):
     "turn a vm device dictionary into a vif object"
-    return VIF(**props)
+    vif = VIF(**props)
+    vif.dev = 'vif%d.%d' % (domid, index)
+
+    return vif
diff -r b075559944d1 -r 1d09d8eecc3a tools/python/xen/remus/vm.py
--- a/tools/python/xen/remus/vm.py      Tue Jun 22 07:28:47 2010 +0100
+++ b/tools/python/xen/remus/vm.py      Tue Jun 22 07:29:26 2010 +0100
@@ -113,7 +113,13 @@ def getvifs(dom):
     if type(vifs) != list:
         vifs = [vifs]
 
-    return [vif.parse(v) for v in vifs]
+    vifno = 0
+    parsed = []
+    for v in vifs:
+        parsed.append(vif.parse(v, dom['domid'], vifno))
+        vifno += 1
+
+    return parsed
 
 def getdisks(dom):
     "return block device objects for devices in dom"

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] Remus: include device name in vif objects, Xen patchbot-4.0-testing <=