xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Shriram Rajagopalan <rshriram@cs.ubc.ca>
To: xen-devel@lists.xensource.com
Cc: ian.jackson@eu.citrix.com
Subject: [PATCH 3 of 3] remus: handle exceptions while installing/unstalling net buffer
Date: Mon, 06 Jun 2011 04:51:52 -0700	[thread overview]
Message-ID: <0af6803eeb9f278abd17.1307361112@athos.nss.cs.ubc.ca> (raw)
In-Reply-To: <patchbomb.1307361109@athos.nss.cs.ubc.ca>

# HG changeset patch
# User Shriram Rajagopalan <rshriram@cs.ubc.ca>
# Date 1307360451 25200
# Node ID 0af6803eeb9f278abd1739cb54ceb0fc2ed14470
# Parent  dc243b6893366c453834734e0b4b17a3f233daa2
remus: handle exceptions while installing/unstalling net buffer

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>

diff -r dc243b689336 -r 0af6803eeb9f tools/python/xen/remus/device.py
--- a/tools/python/xen/remus/device.py	Mon Jun 06 04:40:42 2011 -0700
+++ b/tools/python/xen/remus/device.py	Mon Jun 06 04:40:51 2011 -0700
@@ -169,15 +169,21 @@
         self.vif = vif
         # voodoo from http://www.linuxfoundation.org/collaborate/workgroups/networking/ifb#Typical_Usage
         util.runcmd('ip link set %s up' % self.devname)
-        util.runcmd('tc qdisc add dev %s ingress' % vif.dev)
+        try:
+            util.runcmd('tc qdisc add dev %s ingress' % vif.dev)
+        except: #RTNETLINK file exists error
+            ##since we already track ifbs via the /var/run/remus/ifb file,
+            ## RTNETLINK file already exists error is not an issue.
+            pass
         util.runcmd('tc filter add dev %s parent ffff: proto ip pref 10 '
                     'u32 match u32 0 0 action mirred egress redirect '
                     'dev %s' % (vif.dev, self.devname))
 
     def uninstall(self):
-        util.runcmd('tc filter del dev %s parent ffff: proto ip pref 10 u32' \
-                        % self.vif.dev)
-        util.runcmd('tc qdisc del dev %s ingress' % self.vif.dev)
+        try:
+            util.runcmd('tc qdisc del dev %s ingress' % self.vif.dev)
+        except:
+            pass
         util.runcmd('ip link set %s down' % self.devname)
 
 class IMQBuffer(Netbuf):
@@ -373,9 +379,14 @@
 
     def uninstall(self):
         if self.installed:
-            req = qdisc.delrequest(self.bufdevno, self.handle)
-            self.rth.talk(req.pack())
-            self.installed = False
-
-        self.bufdev.uninstall()
+            try:
+                req = qdisc.delrequest(self.bufdevno, self.handle)
+                self.rth.talk(req.pack())
+                self.installed = False
+            except:
+                pass
+        try:    
+            self.bufdev.uninstall()
+        except:
+            pass
         self.pool.put(self.bufdev)

  parent reply	other threads:[~2011-06-06 11:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06 11:51 [PATCH 0 of 3] remus: cleanup python code Shriram Rajagopalan
2011-06-06 11:51 ` [PATCH 1 of 3] remus: remove dead code and unused modules Shriram Rajagopalan
2011-06-06 11:51 ` [PATCH 2 of 3] remus: move makeheader from image.py to vm.py Shriram Rajagopalan
2011-06-06 11:51 ` Shriram Rajagopalan [this message]
2011-06-07 19:27   ` [PATCH 3 of 3] remus: handle exceptions while installing/unstalling net buffer Brendan Cully
2011-06-21 17:06     ` Ian Jackson
2011-06-21 18:43       ` Shriram Rajagopalan
  -- strict thread matches above, loose matches on Subject: below --
2011-06-22 13:37 [PATCH 0 of 3] [Resend v2] remus: cleanup python code Shriram Rajagopalan
2011-06-22 13:37 ` [PATCH 3 of 3] remus: handle exceptions while installing/unstalling net buffer Shriram Rajagopalan
2011-06-23 15:32   ` Shriram Rajagopalan
2011-06-27 14:19     ` Ian Jackson

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=0af6803eeb9f278abd17.1307361112@athos.nss.cs.ubc.ca \
    --to=rshriram@cs.ubc.ca \
    --cc=ian.jackson@eu.citrix.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 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).