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

[Xen-API] [PATCH 2 of 3] [PATCH] xenserver: Kill bond master's dhclient

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 2 of 3] [PATCH] xenserver: Kill bond master's dhclient when bringing up bond slave
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Thu, 8 Jul 2010 14:33:48 +0100
Delivery-date: Thu, 08 Jul 2010 06:53:29 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1278596026@ely>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1278596026@ely>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
# HG changeset patch
# User Ben Pfaff <blp@xxxxxxxxxx>
# Date 1278596006 -3600
# Node ID 017805983e8d424619afbd8e258ed086d11307af
# Parent  26f08e08cf3ce4fa91bd4249e0b52c6f6d73345d
[PATCH] xenserver: Kill bond master's dhclient when bringing up bond slave.

>From fe19e820e4e543ee29b1b159be8ef8ee03947650 Mon Sep 17 00:00:00 2001
Date: Mon, 28 Jun 2010 10:34:10 -0700
interface-reconfigure is never explicitly called to down a bond master.
However, when it is called to up a slave it is implicit that we are
destroying the master.  The "bridge" version of interface-reconfigure
always "ifdown"s the bond master in such a case, but until now the
"vswitch" version has not done so.  Usually, it doesn't matter, because
the bond master network device disappears when the slave is brought up,
but one case was missed: for a bond master with an IP address obtained
via DHCP, the dhclient process needs to be killed, and we were not doing
it.  This commit starts doing it (by invoking ifdown on the bond master).

The dhclient process that hangs around doesn't cause problems until the
bond master is brought back up, at which point "ifup" fails because it
refuses to start another dhclient for the same interface.

The converse behavior is also important; that is, when a bond PIF is
brought up, interface-reconfigure is expected to implicitly take down its
slave PIFs.  My testing (on 5.5.0) shows that this behavior is already
correct.  At any rate, this commit does not change that behavior.

Bug #2668.
Bug #2734.

Signed-off-by: Ben Pfaff <blp@xxxxxxxxxx>
Signed-off-by: Dominic Curran <dominic.curran@xxxxxxxxxx>
---
 ...ensource_libexec_InterfaceReconfigureVswitch.py |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff -r 26f08e08cf3c -r 017805983e8d scripts/InterfaceReconfigureVswitch.py
--- a/scripts/InterfaceReconfigureVswitch.py    Thu Jul 08 14:33:23 2010 +0100
+++ b/scripts/InterfaceReconfigureVswitch.py    Thu Jul 08 14:33:26 2010 +0100
@@ -414,7 +414,18 @@
         self._extra_ports = extra_ports
 
     def bring_down_existing(self):
-        pass
+        # interface-reconfigure is never explicitly called to down a
+        # bond master.  However, when we are called to up a slave it
+        # is implicit that we are destroying the master.
+        #
+        # This is (only) important in the case where the bond master
+        # uses DHCP.  We need to kill the dhclient process, otherwise
+        # bringing the bond master back up later will fail because
+        # ifup will refuse to start a duplicate dhclient.
+        bond_masters = pif_get_bond_masters(self._pif)
+        for master in bond_masters:
+            log("action_up: bring down bond master %s" % 
(pif_netdev_name(master)))
+            run_command(["/sbin/ifdown", pif_bridge_name(master)])
 
     def configure(self):
         # Bring up physical devices. ovs-vswitchd initially enables or
 scripts/InterfaceReconfigureVswitch.py |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)


Attachment: txtn3HmogR3Xd.txt
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>