Skip to content

xenopsd: Avoid calling to_string every time #6206

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

Merged
merged 1 commit into from
Jan 2, 2025
Merged
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
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
Loading