From 5983d6e8330e55d4b1b6c89b63d61b02114acb67 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Wed, 23 Mar 2022 10:06:56 +0000 Subject: [PATCH] fixup! CP-34028: Replace Uuidm with Uuid wherever possible --- ocaml/xenopsd/xc/domain.ml | 8 +++++++- ocaml/xenopsd/xc/xenops_server_xen.ml | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ocaml/xenopsd/xc/domain.ml b/ocaml/xenopsd/xc/domain.ml index c890dfb1ec..6f6d859b10 100644 --- a/ocaml/xenopsd/xc/domain.ml +++ b/ocaml/xenopsd/xc/domain.ml @@ -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 = diff --git a/ocaml/xenopsd/xc/xenops_server_xen.ml b/ocaml/xenopsd/xc/xenops_server_xen.ml index 557c4eba95..9b0419d755 100644 --- a/ocaml/xenopsd/xc/xenops_server_xen.ml +++ b/ocaml/xenopsd/xc/xenops_server_xen.ml @@ -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 =