File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ let modprobe = "/sbin/modprobe"
3333let ethtool = ref " /sbin/ethtool"
3434let bonding_dir = " /proc/net/bonding/"
3535let dhcp6c = " /sbin/dhcp6c"
36+ let fcoedriver = ref " /opt/xensource/libexec/fcoe_driver"
3637
3738let call_script ?(log_successful_output =false ) script args =
3839 try
@@ -546,6 +547,19 @@ module Dhclient = struct
546547 end
547548end
548549
550+ module Fcoe = struct
551+ let call ?(log =false ) args =
552+ call_script ~log_successful_output: log ! fcoedriver args
553+
554+ let get_capabilities name =
555+ try
556+ let output = call [" --xapi" ; name; " capable" ] in
557+ if String. has_substr output " True" then [" fcoe" ] else []
558+ with _ ->
559+ debug " Failed to get fcoe support status on device %s" name;
560+ []
561+ end
562+
549563module Sysctl = struct
550564 let write value variable =
551565 ignore (call_script ~log_successful_output: true sysctl [" -q" ; " -w" ; variable ^ " =" ^ value])
Original file line number Diff line number Diff line change @@ -317,6 +317,11 @@ module Interface = struct
317317 Ethtool. set_offload name params
318318 ) ()
319319
320+ let get_capabilities _ dbg ~name =
321+ Debug. with_thread_associated dbg (fun () ->
322+ Fcoe. get_capabilities name
323+ ) ()
324+
320325 let is_connected _ dbg ~name =
321326 Debug. with_thread_associated dbg (fun () ->
322327 Sysfs. get_carrier name
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ let resources = [
4040 essential = true ;
4141 path = Network_utils. ethtool;
4242 perms = [ Unix. X_OK ];
43+ };
44+ { Xcp_service. name = " fcoedriver" ;
45+ description = " used to identify fcoe interfaces" ;
46+ essential = false ;
47+ path = Network_utils. fcoedriver;
48+ perms = [ Unix. X_OK ];
4349 }
4450]
4551
You can’t perform that action at this time.
0 commit comments