Skip to content

Commit 590437f

Browse files
committed
CP-10532: Change name for virtual hardware platform version
Change from VM.virt_hw_vn and Host.virt_hw_vns to VM.hardware_platform_version and Host.virtual_hardware_platform_versions Signed-off-by: Cheng Zhang <cheng.zhang@citrix.com>
1 parent 1267f24 commit 590437f

14 files changed

+33
-33
lines changed

ocaml/client_records/records.ml

+5-5
Original file line numberDiff line numberDiff line change
@@ -880,8 +880,8 @@ let vm_record rpc session_id vm =
880880
~get:(fun () -> Int64.to_string (x ()).API.vM_version) ();
881881
make_field ~name:"generation-id"
882882
~get:(fun () -> (x ()).API.vM_generation_id) ();
883-
make_field ~name:"virt-hw-vn"
884-
~get:(fun () -> Int64.to_string (x ()).API.vM_virt_hw_vn) ();
883+
make_field ~name:"hardware-platform-version"
884+
~get:(fun () -> Int64.to_string (x ()).API.vM_hardware_platform_version) ();
885885
]}
886886

887887
let host_crashdump_record rpc session_id host =
@@ -1050,9 +1050,9 @@ let host_record rpc session_id host =
10501050
~get_map:(fun () -> (x ()).API.host_guest_VCPUs_params)
10511051
~add_to_map:(fun k v -> Client.Host.add_to_guest_VCPUs_params rpc session_id host k v)
10521052
~remove_from_map:(fun k -> Client.Host.remove_from_guest_VCPUs_params rpc session_id host k) ();
1053-
make_field ~name:"virt_hw_vns"
1054-
~get:(fun () -> String.concat "; " (List.map Int64.to_string (x ()).API.host_virt_hw_vns))
1055-
~get_set:(fun () -> List.map Int64.to_string (x ()).API.host_virt_hw_vns) ();
1053+
make_field ~name:"virtual_hardware_platform_versions"
1054+
~get:(fun () -> String.concat "; " (List.map Int64.to_string (x ()).API.host_virtual_hardware_platform_versions))
1055+
~get_set:(fun () -> List.map Int64.to_string (x ()).API.host_virtual_hardware_platform_versions) ();
10561056
]}
10571057

10581058
let vdi_record rpc session_id vdi =

ocaml/idl/datamodel.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4361,7 +4361,7 @@ let host =
43614361
field ~qualifier:DynamicRO ~lifecycle:[Published, rel_boston, ""] ~ty:(Set (Ref _pci)) "PCIs" "List of PCI devices in the host";
43624362
field ~qualifier:DynamicRO ~lifecycle:[Published, rel_boston, ""] ~ty:(Set (Ref _pgpu)) "PGPUs" "List of physical GPUs in the host";
43634363
field ~qualifier:RW ~in_product_since:rel_tampa ~default_value:(Some (VMap [])) ~ty:(Map (String, String)) "guest_VCPUs_params" "VCPUs params to apply to all resident guests";
4364-
field ~qualifier:DynamicRO ~in_product_since:rel_creedence ~default_value:(Some (VSet [VInt 0L])) ~ty:(Set (Int)) "virt_hw_vns" "The set of versions of the virtual hardware platform that the host can offer to its guests";
4364+
field ~qualifier:DynamicRO ~in_product_since:rel_creedence ~default_value:(Some (VSet [VInt 0L])) ~ty:(Set (Int)) "virtual_hardware_platform_versions" "The set of versions of the virtual hardware platform that the host can offer to its guests";
43654365
])
43664366
()
43674367

@@ -6887,7 +6887,7 @@ let vm =
68876887
field ~writer_roles:_R_VM_ADMIN ~qualifier:RW ~in_product_since:rel_boston ~default_value:(Some (VRef (Ref.string_of Ref.null))) ~ty:(Ref _sr) "suspend_SR" "The SR on which a suspend image is stored";
68886888
field ~qualifier:StaticRO ~in_product_since:rel_boston ~default_value:(Some (VInt 0L)) ~ty:Int "version" "The number of times this VM has been recovered";
68896889
field ~qualifier:StaticRO ~in_product_since:rel_clearwater ~default_value:(Some (VString "0:0")) ~ty:(String) "generation_id" "Generation ID of the VM";
6890-
field ~writer_roles:_R_VM_ADMIN ~qualifier:RW ~in_product_since:rel_creedence ~default_value:(Some (VInt 0L)) ~ty:Int "virt_hw_vn" "The host virtual hardware platform version the VM can run on";
6890+
field ~writer_roles:_R_VM_ADMIN ~qualifier:RW ~in_product_since:rel_creedence ~default_value:(Some (VInt 0L)) ~ty:Int "hardware_platform_version" "The host virtual hardware platform version the VM can run on";
68916891
])
68926892
()
68936893

ocaml/test/test_common.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ let make_vm ~__context ?(name_label="name_label") ?(name_description="descriptio
7777
?(other_config=[]) ?(xenstore_data=[]) ?(recommendations="") ?(ha_always_run=false)
7878
?(ha_restart_priority="") ?(tags=[]) ?(blocked_operations=[]) ?(protection_policy=Ref.null)
7979
?(is_snapshot_from_vmpp=false) ?(appliance=Ref.null) ?(start_delay=0L)
80-
?(shutdown_delay=0L) ?(order=0L) ?(suspend_SR=Ref.null) ?(version=0L) ?(generation_id="0:0") ?(virt_hw_vn=0L) () =
80+
?(shutdown_delay=0L) ?(order=0L) ?(suspend_SR=Ref.null) ?(version=0L) ?(generation_id="0:0") ?(hardware_platform_version=0L) () =
8181
Xapi_vm.create ~__context ~name_label ~name_description ~user_version ~is_a_template
8282
~affinity ~memory_target ~memory_static_max ~memory_dynamic_max ~memory_dynamic_min
8383
~memory_static_min ~vCPUs_params ~vCPUs_max ~vCPUs_at_startup ~actions_after_shutdown
@@ -86,7 +86,7 @@ let make_vm ~__context ?(name_label="name_label") ?(name_description="descriptio
8686
~hVM_shadow_multiplier ~platform ~pCI_bus ~other_config ~xenstore_data ~recommendations
8787
~ha_always_run ~ha_restart_priority ~tags ~blocked_operations ~protection_policy
8888
~is_snapshot_from_vmpp ~appliance ~start_delay ~shutdown_delay ~order ~suspend_SR
89-
~version ~generation_id ~virt_hw_vn
89+
~version ~generation_id ~hardware_platform_version
9090

9191
let make_host ~__context ?(uuid=make_uuid ()) ?(name_label="host")
9292
?(name_description="description") ?(hostname="localhost") ?(address="127.0.0.1")

ocaml/xapi/cli_operations.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ let vm_create printer rpc session_id params =
15531553
~suspend_SR:Ref.null
15541554
~version:0L
15551555
~generation_id:""
1556-
~virt_hw_vn:0L in
1556+
~hardware_platform_version:0L in
15571557
let uuid=Client.VM.get_uuid rpc session_id vm in
15581558
printer (Cli_printer.PList [uuid])
15591559

ocaml/xapi/create_misc.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ and create_domain_zero_record ~__context ~domain_zero_ref (host_info: host_info)
194194
~suspend_SR:Ref.null
195195
~version:0L
196196
~generation_id:""
197-
~virt_hw_vn:0L;
197+
~hardware_platform_version:0L;
198198
Xapi_vm_helpers.update_memory_overhead ~__context ~vm:domain_zero_ref
199199

200200
and create_domain_zero_console_record_with_protocol ~__context ~domain_zero_ref ~dom0_console_protocol =

ocaml/xapi/dbsync_slave.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ let refresh_localhost_info ~__context info =
8282
Db.Host.set_software_version ~__context ~self:host ~value:software_version;
8383
Db.Host.set_API_version_major ~__context ~self:host ~value:Xapi_globs.api_version_major;
8484
Db.Host.set_API_version_minor ~__context ~self:host ~value:Xapi_globs.api_version_minor;
85-
Db.Host.set_virt_hw_vns ~__context ~self:host ~value:Xapi_globs.host_virt_hw_vns;
85+
Db.Host.set_virtual_hardware_platform_versions ~__context ~self:host ~value:Xapi_globs.host_virtual_hardware_platform_versions;
8686
Db.Host.set_hostname ~__context ~self:host ~value:info.hostname;
8787
let caps = String.split ' ' (Xenctrl.with_intf (fun xc -> Xenctrl.version_capabilities xc)) in
8888
Db.Host.set_capabilities ~__context ~self:host ~value:caps;

ocaml/xapi/import_xva.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ let make __context rpc session_id srid (vms, vdis) =
9090
~suspend_SR:Ref.null
9191
~version:0L
9292
~generation_id:""
93-
~virt_hw_vn:0L
93+
~hardware_platform_version:0L
9494
in
9595

9696
TaskHelper.operate_on_db_task ~__context

ocaml/xapi/xapi_globs.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,4 +851,4 @@ let win_auto_update_support = 1L
851851
* reconsider the place(s) from which we call it. *)
852852

853853
(* This set is used as an indicator to show the virtual hardware platform versions the current host offers to its guests *)
854-
let host_virt_hw_vns = [0L; win_auto_update_support]
854+
let host_virtual_hardware_platform_versions = [0L; win_auto_update_support]

ocaml/xapi/xapi_host.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ let create ~__context ~uuid ~name_label ~name_description ~hostname ~address ~ex
607607
~power_on_config:[]
608608
~local_cache_sr
609609
~guest_VCPUs_params:[]
610-
~virt_hw_vns:(if host_is_us then Xapi_globs.host_virt_hw_vns else [0L])
610+
~virtual_hardware_platform_versions:(if host_is_us then Xapi_globs.host_virtual_hardware_platform_versions else [0L])
611611
;
612612
(* If the host we're creating is us, make sure its set to live *)
613613
Db.Host_metrics.set_last_updated ~__context ~self:metrics ~value:(Date.of_float (Unix.gettimeofday ()));

ocaml/xapi/xapi_vm.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ let create ~__context
395395
~suspend_SR
396396
~version
397397
~generation_id
398-
~virt_hw_vn
398+
~hardware_platform_version
399399
: API.ref_VM =
400400
let gen_mac_seed () = Uuid.to_string (Uuid.make_uuid ()) in
401401
(* Add random mac_seed if there isn't one specified already *)
@@ -447,7 +447,7 @@ let create ~__context
447447
~suspend_SR
448448
~version
449449
~generation_id
450-
~virt_hw_vn
450+
~hardware_platform_version
451451

452452
let destroy ~__context ~self =
453453
let parent = Db.VM.get_parent ~__context ~self in

ocaml/xapi/xapi_vm.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ val create :
151151
suspend_SR:[ `SR ] Ref.t ->
152152
version:int64 ->
153153
generation_id:string ->
154-
virt_hw_vn:int64
154+
hardware_platform_version:int64
155155
-> API.ref_VM
156156
val destroy : __context:Context.t -> self:[ `VM ] Ref.t -> unit
157157
val clone :

ocaml/xapi/xapi_vm_clone.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ let copy_vm_record ?(snapshot_info_record) ~__context ~vm ~disk_op ~new_name ~ne
330330
~suspend_SR:Ref.null
331331
~version:0L
332332
~generation_id
333-
~virt_hw_vn:0L
333+
~hardware_platform_version:0L
334334
;
335335

336336
(* update the VM's parent field in case of snapshot. Note this must be done after "ref"

ocaml/xapi/xapi_vm_helpers.ml

+13-13
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ let create ~__context ~name_label ~name_description
7777
~suspend_SR
7878
~version
7979
~generation_id
80-
~virt_hw_vn
80+
~hardware_platform_version
8181
: API.ref_VM =
8282

8383
(* NB parameter validation is delayed until VM.start *)
@@ -144,7 +144,7 @@ let create ~__context ~name_label ~name_description
144144
~suspend_SR
145145
~version
146146
~generation_id
147-
~virt_hw_vn
147+
~hardware_platform_version
148148
;
149149
Db.VM.set_power_state ~__context ~self:vm_ref ~value:`Halted;
150150
Xapi_vm_lifecycle.update_allowed_operations ~__context ~self:vm_ref;
@@ -247,31 +247,31 @@ let validate_basic_parameters ~__context ~self ~snapshot:x =
247247
~hVM_shadow_multiplier:x.API.vM_HVM_shadow_multiplier;
248248
validate_actions_after_crash ~__context ~self ~value:x.API.vM_actions_after_crash
249249

250-
let assert_virt_hw_support ~__context ~vm ~host =
251-
let vm_virt_hw_vn = Db.VM.get_virt_hw_vn ~__context ~self:vm in
252-
let host_virt_hw_vns =
250+
let assert_hardware_platform_support ~__context ~vm ~host =
251+
let vm_hardware_platform_version = Db.VM.get_hardware_platform_version ~__context ~self:vm in
252+
let host_virtual_hardware_platform_versions =
253253
try
254254
match host with
255255
| Helpers.LocalObject host_ref ->
256-
Db.Host.get_virt_hw_vns ~__context ~self:host_ref
256+
Db.Host.get_virtual_hardware_platform_versions ~__context ~self:host_ref
257257
| Helpers.RemoteObject (rpc, session_id, host_ref) ->
258-
Client.Client.Host.get_virt_hw_vns ~rpc ~session_id ~self:host_ref
258+
Client.Client.Host.get_virtual_hardware_platform_versions ~rpc ~session_id ~self:host_ref
259259
with Not_found ->
260260
(* An old host that does not understand the concept
261261
* has implicit support for version 0 *)
262262
[0L]
263263
in
264-
if not (List.mem vm_virt_hw_vn host_virt_hw_vns) then
264+
if not (List.mem vm_hardware_platform_version host_virtual_hardware_platform_versions) then
265265
let host_r = match host with
266266
| Helpers.LocalObject host_ref -> host_ref
267267
| Helpers.RemoteObject (rpc, session_id, host_ref) -> host_ref
268268
in
269269
raise (Api_errors.Server_error (
270270
Api_errors.vm_host_incompatible_virtual_hardware_platform_version, [
271271
Ref.string_of host_r;
272-
"["^(String.concat "; " (List.map Int64.to_string host_virt_hw_vns))^"]";
272+
"["^(String.concat "; " (List.map Int64.to_string host_virtual_hardware_platform_versions))^"]";
273273
Ref.string_of vm;
274-
Int64.to_string vm_virt_hw_vn]))
274+
Int64.to_string vm_hardware_platform_version]))
275275

276276
let assert_host_is_enabled ~__context ~host =
277277
(* Check the host is enabled first *)
@@ -501,7 +501,7 @@ let assert_can_boot_here ~__context ~self ~host ~snapshot ?(do_sr_check=true) ?(
501501
assert_host_is_live ~__context ~host;
502502
assert_host_is_enabled ~__context ~host;
503503
(* Check the host can support the VM's required version of virtual hardware platform *)
504-
assert_virt_hw_support ~__context ~vm:self ~host:(Helpers.LocalObject host);
504+
assert_hardware_platform_support ~__context ~vm:self ~host:(Helpers.LocalObject host);
505505
if do_sr_check then
506506
assert_can_see_SRs ~__context ~self ~host;
507507
assert_can_see_networks ~__context ~self ~host;
@@ -1064,6 +1064,6 @@ let update_vm_virtual_hardware_platform_version ~__context ~vm =
10641064
else
10651065
0L
10661066
in
1067-
let current_version = vm_record.API.vM_virt_hw_vn in
1067+
let current_version = vm_record.API.vM_hardware_platform_version in
10681068
if visibly_required_version > current_version then
1069-
Db.VM.set_virt_hw_vn ~__context ~self:vm ~value:visibly_required_version
1069+
Db.VM.set_hardware_platform_version ~__context ~self:vm ~value:visibly_required_version

ocaml/xapi/xapi_vm_migrate.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ let assert_can_migrate ~__context ~vm ~dest ~live ~vdi_map ~vif_map ~options =
757757
~host_from:(Helpers.LocalObject source_host_ref)
758758
~host_to;
759759
(* Check the host can support the VM's required version of virtual hardware platform *)
760-
Xapi_vm_helpers.assert_virt_hw_support ~__context ~vm ~host:host_to;
760+
Xapi_vm_helpers.assert_hardware_platform_support ~__context ~vm ~host:host_to;
761761

762762
(*Check that the remote host is enabled and not in maintenance mode*)
763763
let check_host_enabled = XenAPI.Host.get_enabled remote_rpc session_id (dest_host_ref) in

0 commit comments

Comments
 (0)