let with_xcs f =
with_xc (fun xc -> with_xs (fun xs -> f xc xs))
+let check_vm_uuid uuid =
+ with_xc (fun xc ->
+ let domid = Vmact.domid_of_uuid xc (Uuid.uuid_of_string uuid) in
+ match domid with
+ | Some domid ->
+ info "domain still present at domid=%d. exiting" domid;
+ exit 2
+ | None -> ()
+ )
+
let check_vm uuid =
let is_running =
try
info "stale socket left by previous xenvm. removing";
Unixext.unlink_safe path
);
- with_xc (fun xc ->
- let domid = Vmact.domid_of_uuid xc (Uuid.uuid_of_string uuid) in
- match domid with
- | Some domid ->
- info "domain still present at domid=%d. exiting" domid;
- exit 2
- | None -> ()
- );
- ()
+
+ (* ignore exception in case we don't have a privcmd.
+ * in this case a domain isn't running anyway *)
+ ignore_exn (fun () -> check_vm_uuid uuid)
(* cmd parsing is the legacy text interface that need to be replaced by a more
json'ish interface. this does for now the parsing from string to (task + command) *)