@@ -236,6 +236,8 @@ module VmExtra = struct
236
236
build_info : Domain .build_info option ;
237
237
ty : Vm .builder_info option ;
238
238
last_start_time : float ;
239
+ nomigrate : bool ; (* platform:nomigrate at boot time *)
240
+ nested_virt : bool (* platform:nested_virt at boot time *)
239
241
} with rpc
240
242
241
243
type non_persistent_t = {
@@ -256,6 +258,19 @@ module VmExtra = struct
256
258
persistent : persistent_t ;
257
259
non_persistent : non_persistent_t ;
258
260
} with rpc
261
+
262
+ let default_persistent_t =
263
+ { build_info = None
264
+ ; ty = None
265
+ ; last_start_time = 0.0
266
+ ; nomigrate = false
267
+ ; nested_virt = false
268
+ }
269
+
270
+ (* override rpc code generated for persistent_t *)
271
+ let persistent_t_of_rpc rpc =
272
+ Rpc. struct_extend rpc (rpc_of_persistent_t default_persistent_t)
273
+ |> persistent_t_of_rpc
259
274
end
260
275
261
276
module DB = struct
@@ -1793,6 +1808,8 @@ module VM = struct
1793
1808
(* Earlier than the PV drivers update time, therefore
1794
1809
any cached PV driver information will be kept. *)
1795
1810
last_start_time = 0. ;
1811
+ nomigrate = false ;
1812
+ nested_virt = false
1796
1813
} |> VmExtra. rpc_of_persistent_t |> Jsonrpc. to_string
1797
1814
1798
1815
(* Could use fold_left to get the same value, but that would necessarily go through the whole list everytime, instead of the first n items, only. *)
@@ -2087,7 +2104,19 @@ module VM = struct
2087
2104
x.VmExtra. persistent, x.VmExtra. non_persistent
2088
2105
| None -> begin
2089
2106
debug " VM = %s; has no stored domain-level configuration, regenerating" vm.Vm. id;
2090
- let persistent = { VmExtra. build_info = None ; ty = None ; last_start_time = Unix. gettimeofday () } in
2107
+ let persistent =
2108
+ { VmExtra. build_info = None
2109
+ ; ty = None
2110
+ ; last_start_time = Unix. gettimeofday ()
2111
+ ; nomigrate = Platform. is_true
2112
+ ~key: " nomigrate"
2113
+ ~platformdata: vm.Xenops_interface.Vm. platformdata
2114
+ ~default: false
2115
+ ; nested_virt= Platform. is_true
2116
+ ~key: " nested_virt"
2117
+ ~platformdata: vm.Xenops_interface.Vm. platformdata
2118
+ ~default: false
2119
+ } in
2091
2120
let non_persistent = generate_non_persistent_state xs vm in
2092
2121
persistent, non_persistent
2093
2122
end in
@@ -2682,6 +2711,14 @@ module VM = struct
2682
2711
end ;
2683
2712
shadow_multiplier_target = shadow_multiplier_target;
2684
2713
hvm;
2714
+ nomigrate = begin match vme with
2715
+ | None -> false
2716
+ | Some x -> x.VmExtra. persistent.VmExtra. nomigrate
2717
+ end ;
2718
+ nested_virt = begin match vme with
2719
+ | None -> false
2720
+ | Some x -> x.VmExtra. persistent.VmExtra. nested_virt
2721
+ end
2685
2722
}
2686
2723
)
2687
2724
0 commit comments