Commit 5b59cdd2 authored by Pino Toscano's avatar Pino Toscano Committed by Richard W.M. Jones

Implement Connect.get_domain_capabilities

Wrap the virConnectGetDomainCapabilities C API.
Signed-off-by: Pino Toscano's avatarPino Toscano <ptoscano@redhat.com>
parent 2fe5859d
......@@ -138,6 +138,8 @@ struct
cb = _call_auth_default_callback;
}
external get_domain_capabilities : ?emulatorbin:string -> ?arch:string -> ?machine:string -> ?virttype:string -> [>`R] t -> string = "ocaml_libvirt_connect_get_domain_capabilities"
external const : [>`R] t -> ro t = "%identity"
end
......
......@@ -456,6 +456,22 @@ sig
of libvirt.
*)
val get_domain_capabilities : ?emulatorbin:string -> ?arch:string -> ?machine:string -> ?virttype:string -> [>`R] t -> string
(** [get_domain_capabilities ()] returns the XML with the
available capabilities of the emulator or libvirt for domains.
The optional flag [?emulatorbin] is used to specify a different
emulator.
The optional flag [?arch] is used to specify a different
architecture.
The optional flag [?machine] is used to specify a different
machine type.
The optional flag [?virttype] is used to specify a different
type of virtualization. *)
external const : [>`R] t -> ro t = "%identity"
(** [const conn] turns a read/write connection into a read-only
connection. Note that the opposite operation is impossible.
......
......@@ -419,6 +419,22 @@ ocaml_libvirt_connect_call_auth_default_callback (value listv)
CAMLreturn (retv);
}
CAMLprim value
ocaml_libvirt_connect_get_domain_capabilities (value emulatorbinv, value archv, value machinev, value virttypev, value connv)
{
CAMLparam5 (emulatorbinv, archv, machinev, virttypev, connv);
CAMLlocal1 (rv);
virConnectPtr conn = Connect_val (connv);
char *r;
NONBLOCKING (r = virConnectGetDomainCapabilities (conn, Optstring_val (emulatorbinv), Optstring_val (archv), Optstring_val (machinev), Optstring_val (virttypev), 0));
CHECK_ERROR (r == NULL, "virConnectGetDomainCapabilities");
rv = caml_copy_string (r);
free (r);
CAMLreturn (rv);
}
CAMLprim value
ocaml_libvirt_domain_get_id (value domv)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment