Skip to content

CP-49147: Reduce size of the pool record (uefi_certificates) #6182

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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/idl/datamodel_pool.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2020,6 +2020,11 @@ let t =
, "22.16.0"
, "Became StaticRO to be editable through new method"
)
; ( Changed
, "25.12.0"
, "Field replaced with a digest. You can still get the actual \
value by calling Host.get_uefi_certificates"
Copy link
Member

Choose a reason for hiding this comment

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

Then we should revert the deprecation status of host.uefi_certificates.

)
]
~default_value:(Some (VString "")) "uefi_certificates"
"The UEFI certificates allowing Secure Boot"
Expand Down
4 changes: 2 additions & 2 deletions ocaml/idl/json_backend/gen_json.ml
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,8 @@ module Version = struct
try Scanf.sscanf name "%d.%d.%d%s" of_chunks
with _ ->
failwith
(Printf.sprintf "Version schema changed, please change this code %s"
__LOC__
(Printf.sprintf "Version schema changed, please change this code %s: %s"
name __LOC__
)

let to_name_date (lst, str) =
Expand Down
2 changes: 1 addition & 1 deletion ocaml/idl/schematest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let hash x = Digest.string x |> Digest.to_hex
(* BEWARE: if this changes, check that schema has been bumped accordingly in
ocaml/idl/datamodel_common.ml, usually schema_minor_vsn *)

let last_known_schema_hash = "ad67a64cd47cdea32085518c1fb38d27"
let last_known_schema_hash = "55f3fcbdb67344ba627fc1dec38fe232"

let current_schema_hash : string =
let open Datamodel_types in
Expand Down
3 changes: 2 additions & 1 deletion ocaml/xapi/helpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,8 @@ let get_active_uefi_certificates ~__context ~self =
in
match (!Xapi_globs.allow_custom_uefi_certs, custom_uefi_certs) with
| false, _ | true, "" ->
Db.Pool.get_uefi_certificates ~__context ~self
let master = Db.Pool.get_master ~__context ~self in
Db.Host.get_uefi_certificates ~__context ~self:master
| true, _ ->
custom_uefi_certs

Expand Down
7 changes: 6 additions & 1 deletion ocaml/xapi/xapi_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2757,7 +2757,12 @@ let write_uefi_certificates_to_disk ~__context ~host =
if Pool_role.is_master () then
Db.Pool.set_uefi_certificates ~__context
~self:(Helpers.get_pool ~__context)
~value:disk_uefi_certs_tar ;
~value:
( if disk_uefi_certs_tar = "" then
""
else
Digest.string disk_uefi_certs_tar |> Digest.to_hex
) ;
let pool_uefi_certs =
Db.Pool.get_custom_uefi_certificates ~__context
~self:(Helpers.get_pool ~__context)
Expand Down
Loading