X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=libvirt%2Flibvirt.ml;h=c03032faf2003f6273abc7542166cbbfd63bc727;hb=a1775ba94cbf77e60e97f5fe00ed3e524ca531a5;hp=15da362486a6a12b084d026750e44e68c6c3ffd2;hpb=2c958f377633ec534d485c261e2380182b05adb9;p=ocaml-libvirt.git diff --git a/libvirt/libvirt.ml b/libvirt/libvirt.ml index 15da362..c03032f 100644 --- a/libvirt/libvirt.ml +++ b/libvirt/libvirt.ml @@ -640,6 +640,12 @@ struct params : typed_param array; } + type xml_desc_flag = + | XmlSecure + | XmlInactive + | XmlUpdateCPU + | XmlMigratable + (* The maximum size for Domain.memory_peek and Domain.block_peek * supported by libvirt. This may change with different versions * of libvirt in the future, hence it's a function. @@ -673,6 +679,7 @@ struct external set_memory : [>`W] t -> int64 -> unit = "ocaml_libvirt_domain_set_memory" external get_info : [>`R] t -> info = "ocaml_libvirt_domain_get_info" external get_xml_desc : [>`R] t -> xml = "ocaml_libvirt_domain_get_xml_desc" + external get_xml_desc_flags : [>`W] t -> xml_desc_flag list -> xml = "ocaml_libvirt_domain_get_xml_desc_flags" external get_scheduler_type : [>`R] t -> string * int = "ocaml_libvirt_domain_get_scheduler_type" external get_scheduler_parameters : [>`R] t -> int -> sched_param array = "ocaml_libvirt_domain_get_scheduler_parameters" external set_scheduler_parameters : [>`W] t -> sched_param array -> unit = "ocaml_libvirt_domain_set_scheduler_parameters" @@ -1609,4 +1616,9 @@ let () = "ocaml_libvirt_virterror" (Virterror (Virterror.no_error ())); Callback.register_exception "ocaml_libvirt_not_supported" (Not_supported ""); - c_init () + c_init (); + Printexc.register_printer ( + function + | Virterror e -> Some (Virterror.to_string e) + | _ -> None + )