This was never in a released libvirt.
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
/* Define to the version of this package. */
#undef PACKAGE_VERSION
virConnectListAllDomains \
])
-# This jobs API was never published and is due to get overhauled
-# in the near future:
-# virJobGetInfo
-# virJobGetDomain
-# virJobGetNetwork
-# virJobCancel
-# virJobFree
-# virDomainCreateLinuxJob
-# virDomainSaveJob
-# virDomainRestoreJob
-# virDomainCoreDumpJob
-# virDomainCreateJob
-# virNetworkCreateXMLJob
-# virNetworkCreateJob
-
dnl Check for optional types added since 0.2.1.
-AC_CHECK_TYPES([virJobPtr, virStoragePoolPtr, virStorageVolPtr],,,
+AC_CHECK_TYPES([virStoragePoolPtr, virStorageVolPtr],,,
[#include <libvirt/libvirt.h>])
dnl Check for basic OCaml environment & findlib.
-list_domains.cmo: ../libvirt/libvirt.cmi
-list_domains.cmx: ../libvirt/libvirt.cmx
-node_info.cmo: ../libvirt/libvirt.cmi
-node_info.cmx: ../libvirt/libvirt.cmx
+node_info.cmo: ../libvirt/libvirt.cmi
+node_info.cmx: ../libvirt/libvirt.cmx
+list_domains.cmo: ../libvirt/libvirt.cmi
+list_domains.cmx: ../libvirt/libvirt.cmx
-libvirt.cmi:
-libvirt_version.cmi:
-libvirt.cmo: libvirt.cmi
-libvirt.cmx: libvirt.cmi
-libvirt_version.cmo: libvirt_version.cmi
-libvirt_version.cmx: libvirt_version.cmi
+libvirt_version.cmi:
+libvirt.cmi:
+libvirt_version.cmo: libvirt_version.cmi
+libvirt_version.cmx: libvirt_version.cmi
+libvirt.cmo: libvirt.cmi
+libvirt.cmx: libvirt.cmi
{ name => "virConnectGetCapabilities", sig => "conn : string" },
{ name => "virDomainCreateLinux", sig => "conn, string, 0U : dom" },
- { name => "virDomainCreateLinuxJob",
- sig => "conn, string, 0U : job", weak => 1 },
{ name => "virDomainFree", sig => "dom : free" },
{ name => "virDomainDestroy", sig => "dom : free" },
{ name => "virDomainLookupByName", sig => "conn, string : dom" },
{ name => "virDomainGetUUIDString", sig => "dom : uuid string" },
{ name => "virDomainGetMaxVcpus", sig => "dom : int" },
{ name => "virDomainSave", sig => "dom, string : unit" },
- { name => "virDomainSaveJob",
- sig => "dom, string : job from dom", weak => 1 },
{ name => "virDomainRestore", sig => "conn, string : unit" },
- { name => "virDomainRestoreJob",
- sig => "conn, string : job", weak => 1 },
{ name => "virDomainCoreDump", sig => "dom, string, 0 : unit" },
- { name => "virDomainCoreDumpJob",
- sig => "dom, string, 0 : job from dom", weak => 1 },
{ name => "virDomainSuspend", sig => "dom : unit" },
{ name => "virDomainResume", sig => "dom : unit" },
{ name => "virDomainShutdown", sig => "dom : unit" },
{ name => "virDomainDefineXML", sig => "conn, string : dom" },
{ name => "virDomainUndefine", sig => "dom : unit" },
{ name => "virDomainCreate", sig => "dom : unit" },
- { name => "virDomainCreateJob",
- sig => "dom, 0U : job from dom", weak => 1 },
{ name => "virDomainAttachDevice", sig => "dom, string : unit" },
{ name => "virDomainDetachDevice", sig => "dom, string : unit" },
{ name => "virDomainGetAutostart", sig => "dom : bool" },
{ name => "virNetworkGetUUIDString", sig => "net : uuid string" },
{ name => "virNetworkUndefine", sig => "net : unit" },
{ name => "virNetworkCreateXML", sig => "conn, string : net" },
- { name => "virNetworkCreateXMLJob",
- sig => "conn, string : job", weak => 1 },
{ name => "virNetworkDefineXML", sig => "conn, string : net" },
{ name => "virNetworkCreate", sig => "net : unit" },
- { name => "virNetworkCreateJob",
- sig => "net : job from net", weak => 1 },
{ name => "virNetworkGetAutostart", sig => "net : bool" },
{ name => "virNetworkSetAutostart", sig => "net, bool : unit" },
{ name => "virStoragePoolLookupByVolume",
sig => "vol : pool from vol", weak => 1 },
- { name => "virJobFree",
- sig => "job : free", weak => 1 },
- { name => "virJobCancel",
- sig => "job : unit", weak => 1 },
- { name => "virJobGetNetwork",
- sig => "job : net from job", weak => 1 },
- { name => "virJobGetDomain",
- sig => "job : dom from job", weak => 1 },
-
);
# Functions we haven't implemented anywhere yet but which are mentioned
elsif ($_ eq "net") { "virNetworkPtr" }
elsif ($_ eq "pool") { "virStoragePoolPtr" }
elsif ($_ eq "vol") { "virStorageVolPtr" }
- elsif ($_ eq "job") { "virJobPtr" }
else {
die "unknown short name $_"
}
} elsif ($_ eq "vol") {
"virStorageVolPtr vol = Volume_val (volv);\n".
" virConnectPtr conn = Connect_volv (volv);"
- } elsif ($_ eq "job") {
- "virJobPtr job = Job_val (jobv);\n".
- " virConnectPtr conn = Connect_jobv (jobv);"
} else {
die "unknown short name $_"
}
elsif ($_ eq "net") { "rv = Val_network (r, connv);" }
elsif ($_ eq "pool") { "rv = Val_pool (r, connv);" }
elsif ($_ eq "vol") { "rv = Val_volume (r, connv);" }
- elsif ($_ eq "job") { "rv = Val_job (r, connv);" }
else {
die "unknown short name $_"
}
elsif ($_ eq "net") { "Network_val (netv) = NULL;" }
elsif ($_ eq "pool") { "Pool_val (poolv) = NULL;" }
elsif ($_ eq "vol") { "Volume_val (volv) = NULL;" }
- elsif ($_ eq "job") { "Job_val (jobv) = NULL;" }
else {
die "unknown short name $_"
}
type rw = [`R|`W]
type ro = [`R]
-type ('a, 'b) job_t
-
module Connect =
struct
type 'rw t
external list_all_domains : 'a Connect.t -> ?want_info:bool -> list_flag list -> 'a t array * info array = "ocaml_libvirt_connect_list_all_domains"
external create_linux : [>`W] Connect.t -> xml -> rw t = "ocaml_libvirt_domain_create_linux"
- external create_linux_job : [>`W] Connect.t -> xml -> ([`Domain], rw) job_t = "ocaml_libvirt_domain_create_linux_job"
external lookup_by_id : 'a Connect.t -> int -> 'a t = "ocaml_libvirt_domain_lookup_by_id"
external lookup_by_uuid : 'a Connect.t -> uuid -> 'a t = "ocaml_libvirt_domain_lookup_by_uuid"
external lookup_by_uuid_string : 'a Connect.t -> string -> 'a t = "ocaml_libvirt_domain_lookup_by_uuid_string"
external suspend : [>`W] t -> unit = "ocaml_libvirt_domain_suspend"
external resume : [>`W] t -> unit = "ocaml_libvirt_domain_resume"
external save : [>`W] t -> filename -> unit = "ocaml_libvirt_domain_save"
- external save_job : [>`W] t -> filename -> ([`Domain_nocreate], rw) job_t = "ocaml_libvirt_domain_save_job"
external restore : [>`W] Connect.t -> filename -> unit = "ocaml_libvirt_domain_restore"
- external restore_job : [>`W] Connect.t -> filename -> ([`Domain_nocreate], rw) job_t = "ocaml_libvirt_domain_restore_job"
external core_dump : [>`W] t -> filename -> unit = "ocaml_libvirt_domain_core_dump"
- external core_dump_job : [>`W] t -> filename -> ([`Domain_nocreate], rw) job_t = "ocaml_libvirt_domain_core_dump_job"
external shutdown : [>`W] t -> unit = "ocaml_libvirt_domain_shutdown"
external reboot : [>`W] t -> unit = "ocaml_libvirt_domain_reboot"
external get_name : [>`R] t -> string = "ocaml_libvirt_domain_get_name"
external define_xml : [>`W] Connect.t -> xml -> rw t = "ocaml_libvirt_domain_define_xml"
external undefine : [>`W] t -> unit = "ocaml_libvirt_domain_undefine"
external create : [>`W] t -> unit = "ocaml_libvirt_domain_create"
- external create_job : [>`W] t -> ([`Domain_nocreate], rw) job_t = "ocaml_libvirt_domain_create_job"
external get_autostart : [>`R] t -> bool = "ocaml_libvirt_domain_get_autostart"
external set_autostart : [>`W] t -> bool -> unit = "ocaml_libvirt_domain_set_autostart"
external set_vcpus : [>`W] t -> int -> unit = "ocaml_libvirt_domain_set_vcpus"
external lookup_by_uuid : 'a Connect.t -> uuid -> 'a t = "ocaml_libvirt_network_lookup_by_uuid"
external lookup_by_uuid_string : 'a Connect.t -> string -> 'a t = "ocaml_libvirt_network_lookup_by_uuid_string"
external create_xml : [>`W] Connect.t -> xml -> rw t = "ocaml_libvirt_network_create_xml"
- external create_xml_job : [>`W] Connect.t -> xml -> ([`Network], rw) job_t = "ocaml_libvirt_network_create_xml_job"
external define_xml : [>`W] Connect.t -> xml -> rw t = "ocaml_libvirt_network_define_xml"
external undefine : [>`W] t -> unit = "ocaml_libvirt_network_undefine"
external create : [>`W] t -> unit = "ocaml_libvirt_network_create"
- external create_job : [>`W] t -> ([`Network_nocreate], rw) job_t = "ocaml_libvirt_network_create_job"
external destroy : [>`W] t -> unit = "ocaml_libvirt_network_destroy"
external free : [>`R] t -> unit = "ocaml_libvirt_network_free"
external get_name : [>`R] t -> string = "ocaml_libvirt_network_get_name"
external const : [>`R] t -> ro t = "%identity"
end
-module Job =
-struct
- type ('jobclass, 'rw) t = ('jobclass, 'rw) job_t
- type job_type = Bounded | Unbounded
- type job_state = Running | Complete | Failed | Cancelled
- type job_info = {
- typ : job_type;
- state : job_state;
- running_time : int;
- remaining_time : int;
- percent_complete : int
- }
- external get_info : ('a,'b) t -> job_info = "ocaml_libvirt_job_get_info"
- external get_domain : ([`Domain], 'a) t -> 'a Domain.t = "ocaml_libvirt_job_get_domain"
- external get_network : ([`Network], 'a) t -> 'a Network.t = "ocaml_libvirt_job_get_network"
- external cancel : ('a,'b) t -> unit = "ocaml_libvirt_job_cancel"
- external free : ('a, [>`R]) t -> unit = "ocaml_libvirt_job_free"
- external const : ('a, [>`R]) t -> ('a, ro) t = "%identity"
-end
-
(* Initialization. *)
external c_init : unit -> unit = "ocaml_libvirt_init"
let () =
use recursive module dependencies.
*)
-type ('a, 'b) job_t
-(** Forward definition of {!Job.t}. *)
-
(** {3 Connections} *)
module Connect :
(** Create a new guest domain (not necessarily a Linux one)
from the given XML.
*)
- val create_linux_job : [>`W] Connect.t -> xml -> ([`Domain], rw) job_t
- (** Asynchronous domain creation. *)
val lookup_by_id : 'a Connect.t -> int -> 'a t
(** Lookup a domain by ID. *)
val lookup_by_uuid : 'a Connect.t -> uuid -> 'a t
(** Resume a domain. *)
val save : [>`W] t -> filename -> unit
(** Suspend a domain, then save it to the file. *)
- val save_job : [>`W] t -> filename -> ([`Domain_nocreate], rw) job_t
- (** Asynchronous domain suspend. *)
val restore : [>`W] Connect.t -> filename -> unit
(** Restore a domain from a file. *)
- val restore_job : [>`W] Connect.t -> filename -> ([`Domain_nocreate], rw) job_t
- (** Asynchronous domain restore. *)
val core_dump : [>`W] t -> filename -> unit
(** Force a domain to core dump to the named file. *)
- val core_dump_job : [>`W] t -> filename -> ([`Domain_nocreate], rw) job_t
- (** Asynchronous core dump. *)
val shutdown : [>`W] t -> unit
(** Shutdown a domain. *)
val reboot : [>`W] t -> unit
(** Undefine a domain - removes its configuration. *)
val create : [>`W] t -> unit
(** Launch a defined (inactive) domain. *)
- val create_job : [>`W] t -> ([`Domain_nocreate], rw) job_t
- (** Asynchronous launch domain. *)
val get_autostart : [>`R] t -> bool
(** Get the autostart flag for a domain. *)
val set_autostart : [>`W] t -> bool -> unit
(** Lookup a network by UUID string. *)
val create_xml : [>`W] Connect.t -> xml -> rw t
(** Create a network. *)
- val create_xml_job : [>`W] Connect.t -> xml -> ([`Network], rw) job_t
- (** Asynchronous create network. *)
val define_xml : [>`W] Connect.t -> xml -> rw t
(** Define but don't activate a network. *)
val undefine : [>`W] t -> unit
(** Undefine configuration of a network. *)
val create : [>`W] t -> unit
(** Start up a defined (inactive) network. *)
- val create_job : [>`W] t -> ([`Network_nocreate], rw) job_t
- (** Asynchronous start network. *)
val destroy : [>`W] t -> unit
(** Destroy a network. *)
val free : [>`R] t -> unit
end
(** Module dealing with storage volumes. *)
-(** {3 Jobs and asynchronous processing} *)
-
-module Job :
-sig
- type ('jobclass, 'rw) t = ('jobclass, 'rw) job_t
- (** A background asynchronous job.
-
- Jobs represent a pending operation such as domain creation.
- The possible types for a job are:
-
-{v
-(`Domain, `W) Job.t Job creating a new domain
-(`Domain_nocreate, `W) Job.t Job acting on an existing domain
-(`Network, `W) Job.t Job creating a new network
-(`Network_nocreate, `W) Job.t Job acting on an existing network
-v}
- *)
-
- type job_type = Bounded | Unbounded
- (** A Bounded job is one where we can estimate time to completion. *)
-
- type job_state = Running | Complete | Failed | Cancelled
- (** State of the job. *)
-
- type job_info = {
- typ : job_type; (** Job type (Bounded, Unbounded) *)
- state : job_state; (** Job state (Running, etc.) *)
- running_time : int; (** Actual running time (seconds) *)
- (** The following fields are only available in Bounded jobs: *)
- remaining_time : int; (** Estimated time left (seconds) *)
- percent_complete : int (** Estimated percent complete *)
- }
-
- val get_info : ('a,'b) t -> job_info
- (** Get information and status about the job. *)
-
- val get_domain : ([`Domain], 'a) t -> 'a Domain.t
- (** Get the completed domain from a job.
-
- You should only call it on a job in state Complete. *)
-
- val get_network : ([`Network], 'a) t -> 'a Network.t
- (** Get the completed network from a job.
-
- You should only call it on a job in state Complete. *)
-
- val cancel : ('a,'b) t -> unit
- (** Cancel a job. *)
-
- val free : ('a, [>`R]) t -> unit
- (** Free a job object in memory.
-
- The job object is automatically freed if it is garbage
- collected. This function just forces it to be freed right
- away.
- *)
-
- external const : ('a, [>`R]) t -> ('a, ro) t = "%identity"
- (** [const conn] turns a read/write job into a read-only
- job. Note that the opposite operation is impossible.
- *)
-end
- (** Module dealing with asynchronous jobs. *)
-
(** {3 Error handling and exceptions} *)
module Virterror :
CAMLreturn (rv);
}
-/* Automatically generated binding for virDomainCreateLinuxJob.
- * In generator.pl this function has signature "conn, string, 0U : job".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRDOMAINCREATELINUXJOB
-extern virJobPtr virDomainCreateLinuxJob (virConnectPtr conn, const char *str, unsigned int flags) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_domain_create_linux_job (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-#ifndef HAVE_VIRDOMAINCREATELINUXJOB
- /* Symbol virDomainCreateLinuxJob not found at compile time. */
- not_supported ("virDomainCreateLinuxJob");
- CAMLnoreturn;
-#else
- /* Check that the symbol virDomainCreateLinuxJob
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virDomainCreateLinuxJob);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virJobPtr r;
-
- NONBLOCKING (r = virDomainCreateLinuxJob (conn, str, 0));
- CHECK_ERROR (!r, conn, "virDomainCreateLinuxJob");
-
- rv = Val_job (r, connv);
-
- CAMLreturn (rv);
-#endif
-}
-
/* Automatically generated binding for virDomainFree.
* In generator.pl this function has signature "dom : free".
*/
CAMLreturn (Val_unit);
}
-/* Automatically generated binding for virDomainSaveJob.
- * In generator.pl this function has signature "dom, string : job from dom".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRDOMAINSAVEJOB
-extern virJobPtr virDomainSaveJob (virDomainPtr dom, const char *str) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_domain_save_job (value domv, value strv)
-{
- CAMLparam2 (domv, strv);
-#ifndef HAVE_VIRDOMAINSAVEJOB
- /* Symbol virDomainSaveJob not found at compile time. */
- not_supported ("virDomainSaveJob");
- CAMLnoreturn;
-#else
- /* Check that the symbol virDomainSaveJob
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virDomainSaveJob);
-
- CAMLlocal2 (rv, connv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- char *str = String_val (strv);
- virJobPtr r;
-
- NONBLOCKING (r = virDomainSaveJob (dom, str));
- CHECK_ERROR (!r, conn, "virDomainSaveJob");
-
- connv = Field (domv, 1);
- rv = Val_job (r, connv);
-
- CAMLreturn (rv);
-#endif
-}
-
/* Automatically generated binding for virDomainRestore.
* In generator.pl this function has signature "conn, string : unit".
*/
CAMLreturn (Val_unit);
}
-/* Automatically generated binding for virDomainRestoreJob.
- * In generator.pl this function has signature "conn, string : job".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRDOMAINRESTOREJOB
-extern virJobPtr virDomainRestoreJob (virConnectPtr conn, const char *str) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_domain_restore_job (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-#ifndef HAVE_VIRDOMAINRESTOREJOB
- /* Symbol virDomainRestoreJob not found at compile time. */
- not_supported ("virDomainRestoreJob");
- CAMLnoreturn;
-#else
- /* Check that the symbol virDomainRestoreJob
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virDomainRestoreJob);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virJobPtr r;
-
- NONBLOCKING (r = virDomainRestoreJob (conn, str));
- CHECK_ERROR (!r, conn, "virDomainRestoreJob");
-
- rv = Val_job (r, connv);
-
- CAMLreturn (rv);
-#endif
-}
-
/* Automatically generated binding for virDomainCoreDump.
* In generator.pl this function has signature "dom, string, 0 : unit".
*/
CAMLreturn (Val_unit);
}
-/* Automatically generated binding for virDomainCoreDumpJob.
- * In generator.pl this function has signature "dom, string, 0 : job from dom".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRDOMAINCOREDUMPJOB
-extern virJobPtr virDomainCoreDumpJob (virDomainPtr dom, const char *str, int flags) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_domain_core_dump_job (value domv, value strv)
-{
- CAMLparam2 (domv, strv);
-#ifndef HAVE_VIRDOMAINCOREDUMPJOB
- /* Symbol virDomainCoreDumpJob not found at compile time. */
- not_supported ("virDomainCoreDumpJob");
- CAMLnoreturn;
-#else
- /* Check that the symbol virDomainCoreDumpJob
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virDomainCoreDumpJob);
-
- CAMLlocal2 (rv, connv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- char *str = String_val (strv);
- virJobPtr r;
-
- NONBLOCKING (r = virDomainCoreDumpJob (dom, str, 0));
- CHECK_ERROR (!r, conn, "virDomainCoreDumpJob");
-
- connv = Field (domv, 1);
- rv = Val_job (r, connv);
-
- CAMLreturn (rv);
-#endif
-}
-
/* Automatically generated binding for virDomainSuspend.
* In generator.pl this function has signature "dom : unit".
*/
CAMLreturn (Val_unit);
}
-/* Automatically generated binding for virDomainCreateJob.
- * In generator.pl this function has signature "dom, 0U : job from dom".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRDOMAINCREATEJOB
-extern virJobPtr virDomainCreateJob (virDomainPtr dom, unsigned int flags) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_domain_create_job (value domv)
-{
- CAMLparam1 (domv);
-#ifndef HAVE_VIRDOMAINCREATEJOB
- /* Symbol virDomainCreateJob not found at compile time. */
- not_supported ("virDomainCreateJob");
- CAMLnoreturn;
-#else
- /* Check that the symbol virDomainCreateJob
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virDomainCreateJob);
-
- CAMLlocal2 (rv, connv);
- virDomainPtr dom = Domain_val (domv);
- virConnectPtr conn = Connect_domv (domv);
- virJobPtr r;
-
- NONBLOCKING (r = virDomainCreateJob (dom, 0));
- CHECK_ERROR (!r, conn, "virDomainCreateJob");
-
- connv = Field (domv, 1);
- rv = Val_job (r, connv);
-
- CAMLreturn (rv);
-#endif
-}
-
/* Automatically generated binding for virDomainAttachDevice.
* In generator.pl this function has signature "dom, string : unit".
*/
CAMLreturn (rv);
}
-/* Automatically generated binding for virNetworkCreateXMLJob.
- * In generator.pl this function has signature "conn, string : job".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRNETWORKCREATEXMLJOB
-extern virJobPtr virNetworkCreateXMLJob (virConnectPtr conn, const char *str) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_network_create_xml_job (value connv, value strv)
-{
- CAMLparam2 (connv, strv);
-#ifndef HAVE_VIRNETWORKCREATEXMLJOB
- /* Symbol virNetworkCreateXMLJob not found at compile time. */
- not_supported ("virNetworkCreateXMLJob");
- CAMLnoreturn;
-#else
- /* Check that the symbol virNetworkCreateXMLJob
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virNetworkCreateXMLJob);
-
- CAMLlocal1 (rv);
- virConnectPtr conn = Connect_val (connv);
- char *str = String_val (strv);
- virJobPtr r;
-
- NONBLOCKING (r = virNetworkCreateXMLJob (conn, str));
- CHECK_ERROR (!r, conn, "virNetworkCreateXMLJob");
-
- rv = Val_job (r, connv);
-
- CAMLreturn (rv);
-#endif
-}
-
/* Automatically generated binding for virNetworkDefineXML.
* In generator.pl this function has signature "conn, string : net".
*/
CAMLreturn (Val_unit);
}
-/* Automatically generated binding for virNetworkCreateJob.
- * In generator.pl this function has signature "net : job from net".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRNETWORKCREATEJOB
-extern virJobPtr virNetworkCreateJob (virNetworkPtr net) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_network_create_job (value netv)
-{
- CAMLparam1 (netv);
-#ifndef HAVE_VIRNETWORKCREATEJOB
- /* Symbol virNetworkCreateJob not found at compile time. */
- not_supported ("virNetworkCreateJob");
- CAMLnoreturn;
-#else
- /* Check that the symbol virNetworkCreateJob
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virNetworkCreateJob);
-
- CAMLlocal2 (rv, connv);
- virNetworkPtr net = Network_val (netv);
- virConnectPtr conn = Connect_netv (netv);
- virJobPtr r;
-
- NONBLOCKING (r = virNetworkCreateJob (net));
- CHECK_ERROR (!r, conn, "virNetworkCreateJob");
-
- connv = Field (netv, 1);
- rv = Val_job (r, connv);
-
- CAMLreturn (rv);
-#endif
-}
-
/* Automatically generated binding for virNetworkGetAutostart.
* In generator.pl this function has signature "net : bool".
*/
#endif
}
-/* Automatically generated binding for virJobFree.
- * In generator.pl this function has signature "job : free".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRJOBFREE
-extern int virJobFree (virJobPtr job) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_job_free (value jobv)
-{
- CAMLparam1 (jobv);
-#ifndef HAVE_VIRJOBFREE
- /* Symbol virJobFree not found at compile time. */
- not_supported ("virJobFree");
- CAMLnoreturn;
-#else
- /* Check that the symbol virJobFree
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virJobFree);
-
- virJobPtr job = Job_val (jobv);
- virConnectPtr conn = Connect_jobv (jobv);
- int r;
-
- NONBLOCKING (r = virJobFree (job));
- CHECK_ERROR (r == -1, conn, "virJobFree");
-
- /* So that we don't double-free in the finalizer: */
- Job_val (jobv) = NULL;
-
- CAMLreturn (Val_unit);
-#endif
-}
-
-/* Automatically generated binding for virJobCancel.
- * In generator.pl this function has signature "job : unit".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRJOBCANCEL
-extern int virJobCancel (virJobPtr job) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_job_cancel (value jobv)
-{
- CAMLparam1 (jobv);
-#ifndef HAVE_VIRJOBCANCEL
- /* Symbol virJobCancel not found at compile time. */
- not_supported ("virJobCancel");
- CAMLnoreturn;
-#else
- /* Check that the symbol virJobCancel
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virJobCancel);
-
- virJobPtr job = Job_val (jobv);
- virConnectPtr conn = Connect_jobv (jobv);
- int r;
-
- NONBLOCKING (r = virJobCancel (job));
- CHECK_ERROR (r == -1, conn, "virJobCancel");
-
- CAMLreturn (Val_unit);
-#endif
-}
-
-/* Automatically generated binding for virJobGetNetwork.
- * In generator.pl this function has signature "job : net from job".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRJOBGETNETWORK
-extern virNetworkPtr virJobGetNetwork (virJobPtr job) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_job_get_network (value jobv)
-{
- CAMLparam1 (jobv);
-#ifndef HAVE_VIRJOBGETNETWORK
- /* Symbol virJobGetNetwork not found at compile time. */
- not_supported ("virJobGetNetwork");
- CAMLnoreturn;
-#else
- /* Check that the symbol virJobGetNetwork
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virJobGetNetwork);
-
- CAMLlocal2 (rv, connv);
- virJobPtr job = Job_val (jobv);
- virConnectPtr conn = Connect_jobv (jobv);
- virNetworkPtr r;
-
- NONBLOCKING (r = virJobGetNetwork (job));
- CHECK_ERROR (!r, conn, "virJobGetNetwork");
-
- connv = Field (jobv, 1);
- rv = Val_network (r, connv);
-
- CAMLreturn (rv);
-#endif
-}
-
-/* Automatically generated binding for virJobGetDomain.
- * In generator.pl this function has signature "job : dom from job".
- */
-
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRJOBGETDOMAIN
-extern virDomainPtr virJobGetDomain (virJobPtr job) __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_job_get_domain (value jobv)
-{
- CAMLparam1 (jobv);
-#ifndef HAVE_VIRJOBGETDOMAIN
- /* Symbol virJobGetDomain not found at compile time. */
- not_supported ("virJobGetDomain");
- CAMLnoreturn;
-#else
- /* Check that the symbol virJobGetDomain
- * is in runtime version of libvirt.
- */
- WEAK_SYMBOL_CHECK (virJobGetDomain);
-
- CAMLlocal2 (rv, connv);
- virJobPtr job = Job_val (jobv);
- virConnectPtr conn = Connect_jobv (jobv);
- virDomainPtr r;
-
- NONBLOCKING (r = virJobGetDomain (job));
- CHECK_ERROR (!r, conn, "virJobGetDomain");
-
- connv = Field (jobv, 1);
- rv = Val_domain (r, connv);
-
- CAMLreturn (rv);
-#endif
-}
-
#include "libvirt_c_epilogue.c"
/* EOF */
#ifdef HAVE_VIRSTORAGEVOLPTR
static void vol_finalize (value);
#endif
-#ifdef HAVE_VIRJOBPTR
-static void jb_finalize (value);
-#endif
static struct custom_operations conn_custom_operations = {
"conn_custom_operations",
};
#endif
-#ifdef HAVE_VIRJOBPTR
-static struct custom_operations jb_custom_operations = {
- "jb_custom_operations",
- jb_finalize,
- custom_compare_default,
- custom_hash_default,
- custom_serialize_default,
- custom_deserialize_default
-};
-#endif
-
static value
Val_connect (virConnectPtr conn)
{
}
#endif
-#ifdef HAVE_VIRJOBPTR
-static value
-Val_jb (virJobPtr jb)
-{
- CAMLparam0 ();
- CAMLlocal1 (rv);
- rv = caml_alloc_custom (&jb_custom_operations,
- sizeof (virJobPtr), 0, 1);
- Jb_val (rv) = jb;
- CAMLreturn (rv);
-}
-#endif
-
/* This wraps up the (dom, conn) pair (Domain.t). */
static value
Val_domain (virDomainPtr dom, value connv)
}
#endif
-#ifdef HAVE_VIRJOBPTR
-/* This wraps up the (jb, conn) pair (Job.t). */
-static value
-Val_job (virJobPtr jb, value connv)
-{
- CAMLparam1 (connv);
- CAMLlocal2 (rv, v);
-
- rv = caml_alloc_tuple (2);
- v = Val_jb (jb);
- Store_field (rv, 0, v);
- Store_field (rv, 1, connv);
- CAMLreturn (rv);
-}
-#endif
-
static void
conn_finalize (value connv)
{
if (vol) (void) virStorageVolFree (vol);
}
#endif
-
-#ifdef HAVE_VIRJOBPTR
-static void
-jb_finalize (value jbv)
-{
- virJobPtr jb = Jb_val (jbv);
- if (jb) (void) virJobFree (jb);
-}
-#endif
#endif
}
-#ifdef HAVE_WEAK_SYMBOLS
-#ifdef HAVE_VIRJOBGETINFO
-extern int virJobGetInfo(virJobPtr job, virJobInfoPtr info)
- __attribute__((weak));
-#endif
-#endif
-
-CAMLprim value
-ocaml_libvirt_job_get_info (value jobv)
-{
-#if HAVE_VIRJOBGETINFO
- CAMLparam1 (jobv);
- CAMLlocal1 (rv);
- virJobPtr job = Job_val (jobv);
- virConnectPtr conn = Connect_jobv (jobv);
- virJobInfo info;
- int r;
-
- WEAK_SYMBOL_CHECK (virJobGetInfo);
- NONBLOCKING (r = virJobGetInfo (job, &info));
- CHECK_ERROR (r == -1, conn, "virJobGetInfo");
-
- rv = caml_alloc (5, 0);
- Store_field (rv, 0, Val_int (info.type));
- Store_field (rv, 1, Val_int (info.state));
- Store_field (rv, 2, Val_int (info.runningTime));
- Store_field (rv, 3, Val_int (info.remainingTime));
- Store_field (rv, 4, Val_int (info.percentComplete));
-
- CAMLreturn (rv);
-#else
- not_supported ("virJobGetInfo");
-#endif
-}
-
/*----------------------------------------------------------------------*/
CAMLprim value
* pairs.
*
* Update 2008/01: Storage pools and volumes work the same way as
- * domains and networks. And jobs.
+ * domains and networks.
*/
/* Unwrap a custom block. */
#ifdef HAVE_VIRSTORAGEVOLPTR
#define Vol_val(rv) (*((virStorageVolPtr *)Data_custom_val(rv)))
#endif
-#ifdef HAVE_VIRJOBPTR
-#define Jb_val(rv) (*((virJobPtr *)Data_custom_val(rv)))
-#endif
/* Wrap up a pointer to something in a custom block. */
static value Val_connect (virConnectPtr conn);
#ifdef HAVE_VIRSTORAGEVOLPTR
static value Val_vol (virStorageVolPtr vol);
#endif
-#ifdef HAVE_VIRJOBPTR
-static value Val_jb (virJobPtr jb);
-#endif
/* Domains and networks are stored as pairs (dom/net, conn), so have
* some convenience functions for unwrapping and wrapping them.
#ifdef HAVE_VIRSTORAGEVOLPTR
#define Volume_val(rv) (Vol_val(Field((rv),0)))
#endif
-#ifdef HAVE_VIRJOBPTR
-#define Job_val(rv) (Jb_val(Field((rv),0)))
-#endif
#define Connect_domv(rv) (Connect_val(Field((rv),1)))
#define Connect_netv(rv) (Connect_val(Field((rv),1)))
#ifdef HAVE_VIRSTORAGEPOOLPTR
#ifdef HAVE_VIRSTORAGEVOLPTR
#define Connect_volv(rv) (Connect_val(Field((rv),1)))
#endif
-#ifdef HAVE_VIRJOBPTR
-#define Connect_jobv(rv) (Connect_val(Field((rv),1)))
-#endif
static value Val_domain (virDomainPtr dom, value connv);
static value Val_network (virNetworkPtr net, value connv);
#ifdef HAVE_VIRSTORAGEVOLPTR
static value Val_volume (virStorageVolPtr vol, value connv);
#endif
-#ifdef HAVE_VIRJOBPTR
-static value Val_job (virJobPtr jb, value connv);
-#endif
-mlvirsh_gettext.cmo:
-mlvirsh_gettext.cmx:
-mlvirsh.cmo: mlvirsh_gettext.cmo ../libvirt/libvirt.cmi
-mlvirsh.cmx: mlvirsh_gettext.cmx ../libvirt/libvirt.cmx
+mlvirsh.cmo: mlvirsh_gettext.cmo ../libvirt/libvirt.cmi
+mlvirsh.cmx: mlvirsh_gettext.cmx ../libvirt/libvirt.cmx
+mlvirsh_gettext.cmo:
+mlvirsh_gettext.cmx: