]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
add a proper exception during pci operations
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Fri, 26 Jun 2009 09:38:32 +0000 (10:38 +0100)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Fri, 26 Jun 2009 09:38:32 +0000 (10:38 +0100)
xenvm/xenvm.ml

index 71b848832531633f5f5ab824f9368574223ff08e..d0ce6886169f6812f45a49f35990e006bdc6e415 100644 (file)
@@ -37,6 +37,15 @@ let string_of_exn exn =
                         (Device_common.string_of_endpoint frontend);
        | Device.PV_Vnc.Failed_to_start ->
                sprintf "vncterm failed to start";
+       | Device.PCI.Cannot_add (devs, exn) ->
+               let devs_str = String.concat "," (List.map (fun (a, b, c, d) -> sprintf "%d:%d:%d.%d" a b c d) devs) in
+               let exn_str = match exn with
+                       | Unix.Unix_error (err, act, d) ->
+                               sprintf "unix error doing %s: %s" act (Unix.error_message err)
+                       | _                             ->
+                               Printexc.to_string exn
+                       in
+               sprintf "cannot add pci devices [%s]: %s" devs_str exn_str
        | Forkhelpers.Spawn_internal_error (log, output, process) ->
                let string_of_unix_process process =
                        match process with