@@ -369,6 +369,10 @@ let bring_pif_up ~__context ?(management_interface=false) (pif: API.ref_PIF) =
369
369
let rc = Db.PIF. get_record ~__context ~self: pif in
370
370
let net_rc = Db.Network. get_record ~__context ~self: rc.API. pIF_network in
371
371
let bridge = net_rc.API. network_bridge in
372
+ let driver_domain =
373
+ Opt. map (fun self -> Db.VM. get_uuid ~__context ~self )
374
+ (Network. get_driver_domain ~__context pif)
375
+ in
372
376
373
377
(* Call networkd even if currently_attached is false, just to update its state *)
374
378
debug " Making sure that PIF %s is up" rc.API. pIF_uuid;
@@ -390,8 +394,18 @@ let bring_pif_up ~__context ?(management_interface=false) (pif: API.ref_PIF) =
390
394
Opt. iter (fun name -> Net. set_gateway_interface dbg ~name ) gateway_if;
391
395
Opt. iter (fun name -> Net. set_dns_interface dbg ~name ) dns_if;
392
396
393
- (* Setup network infrastructure *)
397
+ (* Get network infrastructure configuration *)
394
398
let cleanup, bridge_config, interface_config = create_bridges ~__context rc net_rc in
399
+
400
+ (* Set driver domains *)
401
+ List. iter (fun (name , _ ) ->
402
+ Opt. iter (fun uuid -> Net.Bridge. set_driver_domain dbg ~name ~uuid ) driver_domain
403
+ ) bridge_config;
404
+ List. iter (fun (name , _ ) ->
405
+ Opt. iter (fun uuid -> Net.Interface. set_driver_domain dbg ~name ~uuid ) driver_domain
406
+ ) interface_config;
407
+
408
+ (* Make it happen *)
395
409
List. iter (fun (name , force ) -> Net.Bridge. destroy dbg ~name ~force () ) cleanup;
396
410
Net.Bridge. make_config dbg ~config: bridge_config () ;
397
411
Net.Interface. make_config dbg ~config: interface_config () ;
@@ -460,6 +474,13 @@ let bring_pif_up ~__context ?(management_interface=false) (pif: API.ref_PIF) =
460
474
let (ethtool_settings, ethtool_offload) = determine_ethtool_settings net_rc.API. network_other_config in
461
475
let interface_config = [bridge, {ipv4_conf; ipv4_gateway; ipv6_conf; ipv6_gateway;
462
476
ipv4_routes; dns; ethtool_settings; ethtool_offload; mtu; persistent_i= persistent}] in
477
+
478
+ (* Set driver domains *)
479
+ List. iter (fun (name , _ ) ->
480
+ Opt. iter (fun uuid -> Net.Interface. set_driver_domain dbg ~name ~uuid ) driver_domain
481
+ ) interface_config;
482
+
483
+ (* Make it happen *)
463
484
Net.Interface. make_config dbg ~config: interface_config ()
464
485
);
465
486
0 commit comments