Skip to content

CA-363700: update xenopsd platformdata if rtc-timeoffset changes #4665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ocaml/xenopsd/xc/xenops_server_xen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4788,10 +4788,15 @@ module Actions = struct
(Option.map (function {VmExtra.persistent} as extra ->
( match persistent with
| {VmExtra.ty= Some (Vm.HVM hvm_info)} ->
let platformdata =
("timeoffset", timeoffset)
:: List.remove_assoc "timeoffset" persistent.platformdata
in
Comment on lines +4791 to +4794
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Listext has a replace_assoc function, not sure if it's of any advantage here:

Suggested change
let platformdata =
("timeoffset", timeoffset)
:: List.remove_assoc "timeoffset" persistent.platformdata
in
let platformdata =
Xapi_stdext_std.Listext.List.replace_assoc "timeoffset"
timeoffset persistent.platformdata
in

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I usually try to use the standard library unless it becomes too cumbersome.

let persistent =
{
persistent with
VmExtra.ty= Some (Vm.HVM {hvm_info with Vm.timeoffset})
; platformdata
}
in
debug "VM = %s; rtc/timeoffset <- %s" vm timeoffset ;
Expand Down