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/
Home Products Support Community News


[Xen-API] [PATCH] Remove bond-slave filter from PIF.scan

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] Remove bond-slave filter from PIF.scan
From: Rob Hoes <rob.hoes@xxxxxxxxxx>
Date: Fri, 4 Jun 2010 11:45:40 +0100
Delivery-date: Fri, 04 Jun 2010 03:48:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
Remove bond-slave filter from PIF.scan

This filter uses sysfs to find out whether an interface is a bond slave. This 
does not work when the openvswitch backend is used. Besides, it does not seem 
to be necessary (anymore?) anyway.

PIF.scan creates a new PIF for each interface it finds if this interface is 
physical and there is no PIF with the same MAC. The slave interfaces always 
have the same MAC as the bond master PIF (bridging backend) or their "real" 
MACs as stored in their PIFs (openvswitch backend). Therefore, when a bond is 
in effect, the MACs of all bond slaves have corresponding PIFs in the DB, so 
PIF.scan won't create new ones.

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r 20b3b5da0f44 ocaml/xapi/xapi_pif.ml
--- a/ocaml/xapi/xapi_pif.ml
+++ b/ocaml/xapi/xapi_pif.ml
@@ -272,15 +272,6 @@
   let existing_macs = List.map fst t.mac_to_pif_table in
   let physical_macs = List.map fst t.mac_to_phy_table in
-  (* Filter out the interfaces that are enslaved as part of bonds: CA-12690 *)
-  let physical_macs =
-    List.filter
-      (fun mac ->
-        let device = List.assoc mac t.mac_to_phy_table in
-        let is_enslaved = try Unix.access ("/sys/class/net/"^device^"/master") 
[Unix.F_OK]; true with _ -> false in
-        not is_enslaved)
-      physical_macs in
   (* Create PIF records for the new interfaces *)
     (fun mac -> 

Attachment: pif-scan-simplify
Description: Text document

xen-api mailing list
<Prev in Thread] Current Thread [Next in Thread>