Skip to content

Commit

Permalink
fixup! CP-34028: Replace Uuidm with Uuid wherever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
psafont committed Mar 25, 2022
1 parent 275be34 commit 5983d6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion ocaml/xenopsd/xc/domain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,19 @@ let rec xenstore_iter t fn path =
names

let get_uuid ~xc domid =
let string_of_domain_handle handle =
Array.to_list handle |> List.map string_of_int |> String.concat "; "
in
let raw_uuid = (Xenctrl.domain_getinfo xc domid).Xenctrl.handle in
match Uuid.of_int_array raw_uuid with
| Some x ->
x
| None ->
failwith
(Printf.sprintf "VM handle for domain %i is an invalid uuid" domid)
(Printf.sprintf "VM handle for domain %i is an invalid uuid: %a" domid
(fun () -> string_of_domain_handle)
raw_uuid
)

let wait_xen_free_mem ~xc ?(maximum_wait_time_seconds = 64) required_memory_kib
: bool =
Expand Down
7 changes: 6 additions & 1 deletion ocaml/xenopsd/xc/xenops_server_xen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5000,13 +5000,18 @@ module Actions = struct
List.iter (remove_device_watch xs) old_devices
in
let uuid_of_domain di =
let string_of_domain_handle handle =
Array.to_list handle |> List.map string_of_int |> String.concat "; "
in
match Uuid.of_int_array di.Xenctrl.handle with
| Some x ->
x
| None ->
failwith
(Printf.sprintf "VM handle for domain %i is an invalid uuid"
(Printf.sprintf "VM handle for domain %i is an invalid uuid: %a"
di.Xenctrl.domid
(fun () -> string_of_domain_handle)
di.Xenctrl.handle
)
in
let fire_event_on_vm domid =
Expand Down

0 comments on commit 5983d6e

Please sign in to comment.