Skip to content

Commit 22583ad

Browse files
committed
CA-62024: The mark_pif_as_dirty function does not need a VLAN tag anymore
Signed-off-by: Rob Hoes <[email protected]>
1 parent 90a7e34 commit 22583ad

File tree

3 files changed

+8
-23
lines changed

3 files changed

+8
-23
lines changed

ocaml/xapi/helpers.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ let get_rpc () =
4747
None -> failwith "No rpc set!"
4848
| Some f -> f
4949

50-
(* Given a device-name and a VLAN, figure out what the dom0 device name is that corresponds to this: *)
51-
let get_dom0_network_device_name dev vlan =
52-
if vlan = -1L then dev else Printf.sprintf "%s.%Ld" dev vlan
53-
5450
(* !! FIXME - trap proper MISSINGREFERENCE exception when this has been defined *)
5551
(* !! FIXME(2) - this code could be shared with the CLI? *)
5652
let checknull f =

ocaml/xapi/xapi_pif.ml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,13 @@ let db_introduce = pool_introduce
300300

301301
let db_forget ~__context ~self = Db.PIF.destroy ~__context ~self
302302

303-
let mark_pif_as_dirty device vLAN =
303+
(* This signals the monitor thread to tell it that it should sync the database
304+
* with the current dom0 networking config. *)
305+
let mark_pif_as_dirty device =
304306
Threadext.Mutex.execute
305307
(Rrd_shared.mutex)
306308
(fun () ->
307-
Rrd_shared.dirty_pifs :=
308-
Rrd_shared.StringSet.add
309-
(Helpers.get_dom0_network_device_name device vLAN)
310-
(!Rrd_shared.dirty_pifs);
309+
Rrd_shared.dirty_pifs := Rrd_shared.StringSet.add device (!Rrd_shared.dirty_pifs);
311310
Condition.broadcast Rrd_shared.condition)
312311

313312
(* Internal [introduce] is passed a pre-built table [t] *)
@@ -360,7 +359,7 @@ let introduce_internal
360359
* subsequent changes to this PIFs' device's dom0 configuration
361360
* will be reflected accordingly]
362361
*)
363-
mark_pif_as_dirty device vLAN;
362+
mark_pif_as_dirty device;
364363

365364
(* return ref of newly created pif record *)
366365
pif
@@ -552,9 +551,7 @@ let reconfigure_ip ~__context ~self ~mode ~iP ~netmask ~gateway ~dNS =
552551
* a PIF.reconfigure_ip to set mode=dhcp, but you have already
553552
* got an IP on the dom0 device (e.g. because it's a management
554553
* i/f that was brought up independently by init scripts) *)
555-
mark_pif_as_dirty
556-
(Db.PIF.get_device ~__context ~self)
557-
(Db.PIF.get_VLAN ~__context ~self)
554+
mark_pif_as_dirty (Db.PIF.get_device ~__context ~self)
558555

559556
let rec unplug ~__context ~self =
560557
assert_no_protection_enabled ~__context ~self;
@@ -576,9 +573,7 @@ let rec unplug ~__context ~self =
576573
unplug ~__context ~self:access_PIF
577574
end;
578575
Nm.bring_pif_down ~__context self;
579-
mark_pif_as_dirty
580-
(Db.PIF.get_device ~__context ~self)
581-
(-1L)
576+
mark_pif_as_dirty (Db.PIF.get_device ~__context ~self)
582577

583578
let rec plug ~__context ~self =
584579
let network = Db.PIF.get_network ~__context ~self in
@@ -600,9 +595,7 @@ let rec plug ~__context ~self =
600595
end
601596
end;
602597
Xapi_network.attach ~__context ~network ~host;
603-
mark_pif_as_dirty
604-
(Db.PIF.get_device ~__context ~self)
605-
(-1L)
598+
mark_pif_as_dirty (Db.PIF.get_device ~__context ~self)
606599

607600
let calculate_pifs_required_at_start_of_day ~__context =
608601
let localhost = Helpers.get_localhost ~__context in

ocaml/xapi/xapi_pif.mli

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,6 @@ val pool_introduce :
166166
other_config:(string * string) list ->
167167
disallow_unplug:bool -> [ `PIF ] Ref.t
168168

169-
(** This signals the monitor thread to tell it that it should write to the database
170-
* to sync it with the current dom0 networking config. *)
171-
val mark_pif_as_dirty : Rrd_shared.StringSet.elt -> int64 -> unit
172-
173169
(** Create a new PIF record with the given details. Also create a network for the
174170
* new PIF, or reuses an existing one if the name matches the convention prescribed
175171
* by the function {!bridge_naming_convention}. Also check whether the new PIF

0 commit comments

Comments
 (0)