Skip to content

Commit 53752d2

Browse files
committed
fixup: fix the review comment
- refine n_of_xenbrn_opt by add %! - change back to get_mac when update db feild MAC The mac_table is filtered by physical but pif device may be non physical Signed-off-by: Changlei Li <[email protected]>
1 parent 3b21c30 commit 53752d2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

ocaml/xapi/xapi_pif.ml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let bridge_naming_convention (device : string) (pos_opt : int option) =
4646
"br" ^ device
4747

4848
let n_of_xenbrn_opt bridge =
49-
try Scanf.sscanf bridge "xenbr%d" Option.some with _ -> None
49+
try Scanf.sscanf bridge "xenbr%d%!" Option.some with _ -> None
5050

5151
type tables = {
5252
device_to_position_table: (string * int) list
@@ -138,10 +138,7 @@ let refresh_internal ~__context ~interface_tables ~self =
138138
(fun () -> pif_device_name)
139139
Fun.id ;
140140
maybe_update_database "MAC" pif.API.pIF_MAC Db.PIF.set_MAC
141-
(fun () ->
142-
List.assoc_opt pif_device_name interface_tables.device_to_mac_table
143-
|> Option.value ~default:"NotFound"
144-
)
141+
(fun () -> Net.Interface.get_mac dbg pif_device_name)
145142
Fun.id
146143
) ;
147144
maybe_update_database "PCI" pif.API.pIF_PCI Db.PIF.set_PCI

0 commit comments

Comments
 (0)