Skip to content

Commit

Permalink
xenopsd: Avoid calling to_string every time (#6206)
Browse files Browse the repository at this point in the history
Minor style.

`uuid` is always converted to string, avoid doing it every time it's
used.
  • Loading branch information
psafont authored Jan 2, 2025
2 parents 5f6b500 + 75f0b41 commit 34b5b63
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ocaml/xenopsd/xc/domain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ let shutdown_wait_for_ack (t : Xenops_task.task_handle) ~timeout ~xc ~xs domid
(domain_type : [`pv | `pvh | `hvm]) req =
let di = Xenctrl.domain_getinfo xc domid in
let uuid = get_uuid ~xc domid in
let uuid = Uuidx.to_string uuid in
let expecting_ack =
match (di.Xenctrl.hvm_guest, domain_type) with
| false, _ ->
Expand All @@ -640,12 +641,12 @@ let shutdown_wait_for_ack (t : Xenops_task.task_handle) ~timeout ~xc ~xs domid
debug
"VM = %s; domid = %d; HVM guest without PV drivers: not expecting any \
acknowledgement"
(Uuidx.to_string uuid) domid ;
uuid domid ;
Xenctrl.domain_shutdown xc domid (shutdown_to_xc_shutdown req)
) else (
debug
"VM = %s; domid = %d; Waiting for domain to acknowledge shutdown request"
(Uuidx.to_string uuid) domid ;
uuid domid ;
let path = control_shutdown ~xs domid in
let cancel = Domain domid in
if
Expand All @@ -654,11 +655,10 @@ let shutdown_wait_for_ack (t : Xenops_task.task_handle) ~timeout ~xc ~xs domid
[Watch.key_to_disappear path]
t ~xs ~timeout ()
then
info "VM = %s; domid = %d; Domain acknowledged shutdown request"
(Uuidx.to_string uuid) domid
else
debug "VM = %s; domid = %d; Domain disappeared" (Uuidx.to_string uuid)
info "VM = %s; domid = %d; Domain acknowledged shutdown request" uuid
domid
else
debug "VM = %s; domid = %d; Domain disappeared" uuid domid
)

let sysrq ~xs domid key =
Expand Down

0 comments on commit 34b5b63

Please sign in to comment.