Skip to content

Commit 34b5b63

Browse files
authored
xenopsd: Avoid calling to_string every time (#6206)
Minor style. `uuid` is always converted to string, avoid doing it every time it's used.
2 parents 5f6b500 + 75f0b41 commit 34b5b63

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ocaml/xenopsd/xc/domain.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ let shutdown_wait_for_ack (t : Xenops_task.task_handle) ~timeout ~xc ~xs domid
625625
(domain_type : [`pv | `pvh | `hvm]) req =
626626
let di = Xenctrl.domain_getinfo xc domid in
627627
let uuid = get_uuid ~xc domid in
628+
let uuid = Uuidx.to_string uuid in
628629
let expecting_ack =
629630
match (di.Xenctrl.hvm_guest, domain_type) with
630631
| false, _ ->
@@ -640,12 +641,12 @@ let shutdown_wait_for_ack (t : Xenops_task.task_handle) ~timeout ~xc ~xs domid
640641
debug
641642
"VM = %s; domid = %d; HVM guest without PV drivers: not expecting any \
642643
acknowledgement"
643-
(Uuidx.to_string uuid) domid ;
644+
uuid domid ;
644645
Xenctrl.domain_shutdown xc domid (shutdown_to_xc_shutdown req)
645646
) else (
646647
debug
647648
"VM = %s; domid = %d; Waiting for domain to acknowledge shutdown request"
648-
(Uuidx.to_string uuid) domid ;
649+
uuid domid ;
649650
let path = control_shutdown ~xs domid in
650651
let cancel = Domain domid in
651652
if
@@ -654,11 +655,10 @@ let shutdown_wait_for_ack (t : Xenops_task.task_handle) ~timeout ~xc ~xs domid
654655
[Watch.key_to_disappear path]
655656
t ~xs ~timeout ()
656657
then
657-
info "VM = %s; domid = %d; Domain acknowledged shutdown request"
658-
(Uuidx.to_string uuid) domid
659-
else
660-
debug "VM = %s; domid = %d; Domain disappeared" (Uuidx.to_string uuid)
658+
info "VM = %s; domid = %d; Domain acknowledged shutdown request" uuid
661659
domid
660+
else
661+
debug "VM = %s; domid = %d; Domain disappeared" uuid domid
662662
)
663663

664664
let sysrq ~xs domid key =

0 commit comments

Comments
 (0)