Skip to content

Commit 5d46ad9

Browse files
committed
CA-310516: Define name of temporary vlan only once
Signed-off-by: Pau Ruiz Safont <[email protected]>
1 parent 4c1e2af commit 5d46ad9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/network_config.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ exception Write_error
2323
let empty_config = default_config
2424

2525
let config_file_path = "/var/lib/xcp/networkd.db"
26+
let temp_vlan = "xentemp"
27+
2628

2729
let bridge_naming_convention (device: string) =
2830
if Astring.String.is_prefix ~affix:"eth" device
@@ -56,7 +58,7 @@ let read_management_conf () =
5658
(* At this point, we don't know what the VLAN bridge name will be,
5759
* so use a temporary name. Xapi will replace the bridge once the name
5860
* has been decided on. *)
59-
"xentemp"
61+
temp_vlan
6062
in
6163
debug "No management bridge in inventory file... using %s" bridge;
6264
bridge

networkd/network_server.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ module Interface = struct
486486
let has_vlan dbg name vlan =
487487
(* Identify the vlan is used by kernel which is unknown to XAPI *)
488488
Debug.with_thread_associated dbg (fun () ->
489-
let temp_interfaces = Sysfs.bridge_to_interfaces "xentemp" in
489+
let temp_interfaces = Sysfs.bridge_to_interfaces Network_config.temp_vlan in
490490
List.exists (fun (d, v, p) -> v = vlan && p = name && not (List.mem d temp_interfaces)) (Proc.get_vlans ())
491491
) ()
492492

0 commit comments

Comments
 (0)