]> xenbits.xen.org Git - xenclient/toolstack.git/commitdiff
ignore exception when checking domain directly.
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Mon, 20 Jul 2009 07:57:00 +0000 (08:57 +0100)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Mon, 20 Jul 2009 07:57:00 +0000 (08:57 +0100)
if we don't have a xc interface we assume the domain is not running

xenvm/xenvm.ml

index d1ed4b93b71bf6171d0cbc7055cb8d05fd2200bb..cba0616eef70cba67ff47b9a832af0e85f98451c 100644 (file)
@@ -114,6 +114,16 @@ let with_xs f =
 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
@@ -135,15 +145,10 @@ let check_vm uuid =
                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) *)