From: David Scott Date: Wed, 6 Mar 2013 16:18:03 +0000 (+0000) Subject: Correct typos in the storage interface's phantom types X-Git-Tag: 0.6.1.3~10 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=34a472800ba1908e910318cc5d5ed9588174c1cf;p=ocaml-libvirt.git Correct typos in the storage interface's phantom types A connection is either read/write (type rw = [`R|`W]) or read/only (type ro = [`R]). A function which requires the ability to write needs to take a parameter [> `W] rather than [`W] (which would correspond to a write-only connection). We can now use a read/write connection to call: Pool.set_autostart Volume.create_xml Volume.delete Signed-off-by: David Scott --- diff --git a/libvirt/libvirt.ml b/libvirt/libvirt.ml index 07542a9..443b22b 100644 --- a/libvirt/libvirt.ml +++ b/libvirt/libvirt.ml @@ -536,7 +536,7 @@ struct external get_info : [`R] t -> pool_info = "ocaml_libvirt_storage_pool_get_info" external get_xml_desc : [`R] t -> xml = "ocaml_libvirt_storage_pool_get_xml_desc" external get_autostart : [`R] t -> bool = "ocaml_libvirt_storage_pool_get_autostart" - external set_autostart : [`W] t -> bool -> unit = "ocaml_libvirt_storage_pool_set_autostart" + external set_autostart : [>`W] t -> bool -> unit = "ocaml_libvirt_storage_pool_set_autostart" external num_of_volumes : [`R] t -> int = "ocaml_libvirt_storage_pool_num_of_volumes" external list_volumes : [`R] t -> int -> string array = "ocaml_libvirt_storage_pool_list_volumes" external const : [>`R] t -> ro t = "%identity" @@ -562,8 +562,8 @@ struct external get_path : [`R] t -> string = "ocaml_libvirt_storage_vol_get_path" external get_info : [`R] t -> vol_info = "ocaml_libvirt_storage_vol_get_info" external get_xml_desc : [`R] t -> xml = "ocaml_libvirt_storage_vol_get_xml_desc" - external create_xml : [`W] Pool.t -> xml -> unit = "ocaml_libvirt_storage_vol_create_xml" - external delete : [`W] t -> unit = "ocaml_libvirt_storage_vol_delete" + external create_xml : [>`W] Pool.t -> xml -> unit = "ocaml_libvirt_storage_vol_create_xml" + external delete : [>`W] t -> unit = "ocaml_libvirt_storage_vol_delete" external free : [>`R] t -> unit = "ocaml_libvirt_storage_vol_free" external const : [>`R] t -> ro t = "%identity" end diff --git a/libvirt/libvirt.mli b/libvirt/libvirt.mli index 5a288c0..70cc2c7 100644 --- a/libvirt/libvirt.mli +++ b/libvirt/libvirt.mli @@ -757,7 +757,7 @@ sig (** Get the XML description. *) val get_autostart : [`R] t -> bool (** Get the autostart flag for the storage pool. *) - val set_autostart : [`W] t -> bool -> unit + val set_autostart : [>`W] t -> bool -> unit (** Set the autostart flag for the storage pool. *) val num_of_volumes : [`R] t -> int @@ -810,9 +810,9 @@ sig val get_xml_desc : [`R] t -> xml (** Get the XML description. *) - val create_xml : [`W] Pool.t -> xml -> unit + val create_xml : [>`W] Pool.t -> xml -> unit (** Create a storage volume. *) - val delete : [`W] t -> unit + val delete : [>`W] t -> unit (** Delete a storage volume. *) val free : [>`R] t -> unit (** Free a storage volume object in memory.