From 91977ac530ba8d2eb821981b5a51788caaab2bb8 Mon Sep 17 00:00:00 2001 From: Rob Hoes Date: Fri, 18 Jun 2010 14:32:23 +0100 Subject: [PATCH] Add biosdevname call to Netdev biosdevname is a tool used to find out the "real" device name of a network interface, according to the BIOS. This name is not affected by manual device renaming or changes in the Linux kernel. Signed-off-by: Rob Hoes diff -r 96761a1835c1 netdev/netdev.ml--- a/netdev/netdev.ml +++ b/netdev/netdev.ml @@ -397,6 +397,13 @@ not(List.mem "xen-backend" (String.split '/' link)) with _ -> false +let get_bios_name name = + try + let output, _ = Forkhelpers.execute_command_get_output "/sbin/biosdevname" ["-i"; name] in + let output = String.strip String.isspace output in + output + with _ -> name + (* Dispatch network backend operations. *) let network_config_file = "/etc/xensource/network.conf" --- netdev/netdev.ml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/netdev/netdev.ml b/netdev/netdev.ml index 768dd3b..1f09409 100644 --- a/netdev/netdev.ml +++ b/netdev/netdev.ml @@ -397,6 +397,13 @@ let is_physical name = not(List.mem "xen-backend" (String.split '/' link)) with _ -> false +let get_bios_name name = + try + let output, _ = Forkhelpers.execute_command_get_output "/sbin/biosdevname" ["-i"; name] in + let output = String.strip String.isspace output in + output + with _ -> name + (* Dispatch network backend operations. *) let network_config_file = "/etc/xensource/network.conf" -- 2.39.5