@@ -300,14 +300,13 @@ let db_introduce = pool_introduce
300300
301301let 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
559556let 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
583578let 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
607600let calculate_pifs_required_at_start_of_day ~__context =
608601 let localhost = Helpers. get_localhost ~__context in
0 commit comments