Skip to content

Commit

Permalink
CA-364138 log when about to stop varstored and varstore-guard
Browse files Browse the repository at this point in the history
For debugging lost FDs in varstore-guard, log when whe call it to stop
serving a domain.

Signed-off-by: Christian Lindig <christian.lindig@citrix.com>
  • Loading branch information
lindig committed Mar 9, 2022
1 parent 3945b13 commit 53d0f47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion ocaml/xenopsd/lib/xenops_sandbox.ml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ module Varstore_guard = struct
let stop dbg ~domid ~vm_uuid =
let chroot = varstored_chroot ~domid ~vm_uuid in
if Sys.file_exists chroot.root then (
D.debug "About to stop varstored for %d (%s) %s" domid vm_uuid __LOC__ ;
let gid = chroot.Chroot.gid in
let absolute_socket_path =
Chroot.absolute_path_outside chroot socket_path
Expand All @@ -155,5 +156,7 @@ module Varstore_guard = struct
Varstore_privileged_client.Client.destroy dbg gid absolute_socket_path
) ;
Chroot.destroy chroot
)
) else
D.warn "Can't stop varstored for %d (%s): %s does not exist" domid vm_uuid
chroot.root
end
5 changes: 3 additions & 2 deletions ocaml/xenopsd/xc/device.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2837,10 +2837,11 @@ module Dm_Common = struct
in
let stop_vgpu () = Vgpu.stop ~xs domid in
let stop_varstored () =
let vm_uuid = Xenops_helpers.uuid_of_domid ~xs domid |> Uuidm.to_string in
debug "About to stop varstored for domain %d (%s)" domid vm_uuid ;
Varstored.stop ~xs domid ;
let dbg = Printf.sprintf "stop domid %d" domid in
Xenops_sandbox.Varstore_guard.stop dbg ~domid
~vm_uuid:(Uuidm.to_string (Xenops_helpers.uuid_of_domid ~xs domid))
Xenops_sandbox.Varstore_guard.stop dbg ~domid ~vm_uuid
in
stop_vgpu () ; stop_varstored () ; stop_qemu ()

Expand Down

0 comments on commit 53d0f47

Please sign in to comment.