From 9f1b47376070ef5cb333bb942eef9daafe9ce9eb Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Fri, 26 Jun 2009 10:38:32 +0100 Subject: [PATCH] add a proper exception during pci operations --- xenvm/xenvm.ml | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.39.5