]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
Remove bond-slave filter from PIF.scan
authorRob Hoes <rob.hoes@citrix.com>
Thu, 17 Jun 2010 16:31:00 +0000 (17:31 +0100)
committerRob Hoes <rob.hoes@citrix.com>
Thu, 17 Jun 2010 16:31:00 +0000 (17:31 +0100)
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@citrix.com>
ocaml/xapi/xapi_pif.ml

index f0aba0839f368e24d6a23e2ec353c6f11f2f1169..bcfd86ea78b23105bbebd61219e72c33e4514307 100644 (file)
@@ -272,15 +272,6 @@ let scan ~__context ~host =
   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 *)
   List.iter
     (fun mac ->