File tree 3 files changed +25
-0
lines changed
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"
33
33
let ethtool = ref " /sbin/ethtool"
34
34
let bonding_dir = " /proc/net/bonding/"
35
35
let dhcp6c = " /sbin/dhcp6c"
36
+ let fcoedriver = ref " /opt/xensource/libexec/fcoe_driver"
36
37
37
38
let call_script ?(log_successful_output =false ) script args =
38
39
try
@@ -546,6 +547,19 @@ module Dhclient = struct
546
547
end
547
548
end
548
549
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
+
549
563
module Sysctl = struct
550
564
let write value variable =
551
565
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
317
317
Ethtool. set_offload name params
318
318
) ()
319
319
320
+ let get_capabilities _ dbg ~name =
321
+ Debug. with_thread_associated dbg (fun () ->
322
+ Fcoe. get_capabilities name
323
+ ) ()
324
+
320
325
let is_connected _ dbg ~name =
321
326
Debug. with_thread_associated dbg (fun () ->
322
327
Sysfs. get_carrier name
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ let resources = [
40
40
essential = true ;
41
41
path = Network_utils. ethtool;
42
42
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 ];
43
49
}
44
50
]
45
51
You can’t perform that action at this time.
0 commit comments