From: Vincent Hanquez Date: Fri, 26 Jun 2009 09:38:32 +0000 (+0100) Subject: add a proper exception during pci operations X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9f1b47376070ef5cb333bb942eef9daafe9ce9eb;p=xenclient%2Ftoolstack.git add a proper exception during pci operations --- diff --git a/xenvm/xenvm.ml b/xenvm/xenvm.ml index 71b8488..d0ce688 100644 --- a/xenvm/xenvm.ml +++ b/xenvm/xenvm.ml @@ -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