xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Brendan Cully <brendan@cs.ubc.ca>
To: xen-devel@lists.xensource.com
Subject: [PATCH 5 of 7] Remus: include device name in vif objects
Date: Mon, 03 May 2010 11:53:52 -0700	[thread overview]
Message-ID: <c10edb7433f4546351dc.1272912832@kremvax.cs.ubc.ca> (raw)
In-Reply-To: <patchbomb.1272912827@kremvax.cs.ubc.ca>

[-- Attachment #1: Type: text/plain, Size: 51 bytes --]

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>



[-- Attachment #2: xen-4.0-5.patch --]
[-- Type: text/x-patch, Size: 1413 bytes --]

# HG changeset patch
# User Brendan Cully <brendan@cs.ubc.ca>
# Date 1272694699 25200
# Node ID c10edb7433f4546351dca7b47de0821fa0da795e
# Parent  d72ec2ffeb67195d55e942f50c04f98365eaec74
Remus: include device name in vif objects

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>

diff --git a/tools/python/xen/remus/vif.py b/tools/python/xen/remus/vif.py
--- a/tools/python/xen/remus/vif.py
+++ b/tools/python/xen/remus/vif.py
@@ -2,6 +2,7 @@
 
 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 @@
     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 --git a/tools/python/xen/remus/vm.py b/tools/python/xen/remus/vm.py
--- a/tools/python/xen/remus/vm.py
+++ b/tools/python/xen/remus/vm.py
@@ -113,7 +113,13 @@
     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"

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

  parent reply	other threads:[~2010-05-03 18:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 18:53 [PATCH 0 of 7] Remus: pvops dom0 support Brendan Cully
2010-05-03 18:53 ` [PATCH 1 of 7] Remus: python netlink fixes Brendan Cully
2010-05-03 18:53 ` [PATCH 2 of 7] Remus: remove obsolete code Brendan Cully
2010-05-03 18:53 ` [PATCH 3 of 7] Remus: move device handling into its own module Brendan Cully
2010-05-03 18:53 ` [PATCH 4 of 7] Remus: fix VM stringification Brendan Cully
2010-05-03 19:21   ` Measuring the amount of memory read/written (basically touched) by a domU Yuvraj Agarwal
2010-05-03 19:32     ` Keir Fraser
2010-05-03 18:53 ` Brendan Cully [this message]
2010-05-03 18:53 ` [PATCH 6 of 7] Remus: add file locking and modprobe utility functions Brendan Cully
2010-05-03 18:53 ` [PATCH 7 of 7] Remus: use IFB for net buffer on newer kernels Brendan Cully
2010-05-03 20:05 ` [PATCH 0 of 7] Remus: pvops dom0 support Gilberto Nunes

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=c10edb7433f4546351dc.1272912832@kremvax.cs.ubc.ca \
    --to=brendan@cs.ubc.ca \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).