| Libvirt-gobject Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | Signals | ||||
struct GVirConnection; struct GVirConnectionClass; struct GVirNodeInfo; void gvir_connection_close (GVirConnection *conn); GVirDomain * gvir_connection_create_domain (GVirConnection *conn,GVirConfigDomain *conf,GError **err); GVirStoragePool * gvir_connection_create_storage_pool (GVirConnection *conn,GVirConfigStoragePool *conf,guint flags,GError **err); gboolean gvir_connection_fetch_domains (GVirConnection *conn,GCancellable *cancellable,GError **err); void gvir_connection_fetch_domains_async (GVirConnection *conn,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean gvir_connection_fetch_domains_finish (GVirConnection *conn,GAsyncResult *result,GError **err); gboolean gvir_connection_fetch_storage_pools (GVirConnection *conn,GCancellable *cancellable,GError **err); void gvir_connection_fetch_storage_pools_async (GVirConnection *conn,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean gvir_connection_fetch_storage_pools_finish (GVirConnection *conn,GAsyncResult *result,GError **err); GVirDomain * gvir_connection_find_domain_by_id (GVirConnection *conn,gint id); GVirDomain * gvir_connection_find_domain_by_name (GVirConnection *conn,const gchar *name); GVirInterface * gvir_connection_find_interface_by_mac (GVirConnection *conn,const gchar *macaddr); GVirNetwork * gvir_connection_find_network_by_name (GVirConnection *conn,const gchar *name); GVirNetworkFilter * gvir_connection_find_network_filter_by_name (GVirConnection *conn,const gchar *name); GVirStoragePool * gvir_connection_find_storage_pool_by_name (GVirConnection *conn,const gchar *name); GVirConfigCapabilities * gvir_connection_get_capabilities (GVirConnection *conn,GError **err); void gvir_connection_get_capabilities_async (GVirConnection *conn,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); GVirConfigCapabilities * gvir_connection_get_capabilities_finish (GVirConnection *conn,GAsyncResult *result,GError **err); GVirDomain * gvir_connection_get_domain (GVirConnection *conn,const gchar *uuid); GList * gvir_connection_get_domains (GVirConnection *conn); gchar * gvir_connection_get_hypervisor_name (GVirConnection *conn,GError **err); GVirInterface * gvir_connection_get_interface (GVirConnection *conn,const gchar *name); GList * gvir_connection_get_interfaces (GVirConnection *conn); GVirNetwork * gvir_connection_get_network (GVirConnection *conn,const gchar *uuid); GVirNetworkFilter * gvir_connection_get_network_filter (GVirConnection *conn,const gchar *uuid); GList * gvir_connection_get_network_filters (GVirConnection *conn); GList * gvir_connection_get_networks (GVirConnection *conn); GVirNodeDevice * gvir_connection_get_node_device (GVirConnection *conn,const gchar *name); GList * gvir_connection_get_node_devices (GVirConnection *conn); GVirNodeInfo * gvir_connection_get_node_info (GVirConnection *conn,GError **err); GVirSecret * gvir_connection_get_secret (GVirConnection *conn,const gchar *uuid); GList * gvir_connection_get_secrets (GVirConnection *conn); GVirStoragePool * gvir_connection_get_storage_pool (GVirConnection *conn,const gchar *uuid); GList * gvir_connection_get_storage_pools (GVirConnection *conn); GVirStream * gvir_connection_get_stream (GVirConnection *conn,guint flags); const gchar * gvir_connection_get_uri (GVirConnection *conn); gulong gvir_connection_get_version (GVirConnection *conn,GError **err); gboolean gvir_connection_is_open (GVirConnection *conn); gboolean gvir_connection_is_read_only (GVirConnection *conn); GVirConnection * gvir_connection_new (const char *uri); gboolean gvir_connection_open (GVirConnection *conn,GCancellable *cancellable,GError **err); void gvir_connection_open_async (GVirConnection *conn,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean gvir_connection_open_finish (GVirConnection *conn,GAsyncResult *result,GError **err); gboolean gvir_connection_open_read_only (GVirConnection *conn,GCancellable *cancellable,GError **err); void gvir_connection_open_read_only_async (GVirConnection *conn,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean gvir_connection_open_read_only_finish (GVirConnection *conn,GAsyncResult *result,GError **err); gboolean gvir_connection_restore_domain_from_file (GVirConnection *conn,gchar *filename,GVirConfigDomain *custom_conf,guint flags,GError **err); void gvir_connection_restore_domain_from_file_async (GVirConnection *conn,gchar *filename,GVirConfigDomain *custom_conf,guint flags,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean gvir_connection_restore_domain_from_file_finish (GVirConnection *conn,GAsyncResult *result,GError **err); GVirDomain * gvir_connection_start_domain (GVirConnection *conn,GVirConfigDomain *conf,guint flags,GError **err);
"handle" GVirConnectionHandle* : Read / Write / Construct Only "uri" gchar* : Read / Write / Construct Only
"connection-closed" :Run First"connection-opened" :Run First"domain-added" :Run First"domain-removed" :Run First
struct GVirConnectionClass {
GObjectClass parent_class;
/* signals */
void (*connection_opened)(GVirConnection *conn);
void (*connection_closed)(GVirConnection *conn);
void (*domain_added)(GVirConnection *conn, GVirDomain *dom);
void (*domain_removed)(GVirConnection *conn, GVirDomain *dom);
GVirStream *(*stream_new)(GVirConnection *conn, gpointer handle);
gpointer padding[20];
};
struct GVirNodeInfo {
gchar model[32]; /* string indicating the CPU model */
gulong memory; /* memory size in kilobytes */
guint cpus; /* the number of active CPUs */
guint mhz; /* expected CPU frequency */
guint nodes; /* the number of NUMA cell, 1 for unusual NUMA topologies or uniform memo */
guint sockets; /* number of CPU sockets per node if nodes > 1, total number of CPU socke */
guint cores; /* number of cores per socket */
guint threads; /* number of threads per core */
};
GVirDomain * gvir_connection_create_domain (GVirConnection *conn,GVirConfigDomain *conf,GError **err);
Create the configuration file for a new persistent domain. The returned domain will initially be in the shutoff state.
|
a GVirConnection on which to create the domain |
|
the configuration for the new domain |
Returns : |
the newly created domain, or NULL if an error
occurred. The returned object should be unreffed with g_object_unref()
when no longer needed. [transfer full]
|
GVirStoragePool * gvir_connection_create_storage_pool (GVirConnection *conn,GVirConfigStoragePool *conf,guint flags,GError **err);
|
a GVirConnection on which to create the pool |
|
the configuration for the new storage pool |
|
the flags |
|
return location for any GError |
Returns : |
the newly created storage pool, or NULL if an
error occurred. The returned list should be freed with g_list_free(),
after its elements have been unreffed with g_object_unref(). [transfer full]
|
gboolean gvir_connection_fetch_domains (GVirConnection *conn,GCancellable *cancellable,GError **err);
|
a GVirConnection |
|
cancellation object. [allow-none][transfer none] |
void gvir_connection_fetch_domains_async (GVirConnection *conn,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
|
a GVirConnection |
|
cancellation object. [allow-none][transfer none] |
|
completion callback. [scope async] |
|
opaque data for callback. [closure] |
gboolean gvir_connection_fetch_domains_finish (GVirConnection *conn,GAsyncResult *result,GError **err);
|
a GVirConnection |
|
async method result. [transfer none] |
gboolean gvir_connection_fetch_storage_pools (GVirConnection *conn,GCancellable *cancellable,GError **err);
|
a GVirConnection |
|
cancellation object. [allow-none][transfer none] |
void gvir_connection_fetch_storage_pools_async (GVirConnection *conn,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
|
a GVirConnection |
|
cancellation object. [allow-none][transfer none] |
|
completion callback. [scope async] |
|
opaque data for callback. [closure] |
gboolean gvir_connection_fetch_storage_pools_finish (GVirConnection *conn,GAsyncResult *result,GError **err);
|
a GVirConnection |
|
async method result. [transfer none] |
GVirDomain * gvir_connection_find_domain_by_id (GVirConnection *conn,gint id);
|
a GVirConnection |
|
id of the requested domain |
Returns : |
the GVirDomain, or NULL. The returned
object should be unreffed with g_object_unref() when no longer needed. [transfer full]
|
GVirDomain * gvir_connection_find_domain_by_name (GVirConnection *conn,const gchar *name);
|
a GVirConnection |
|
name of the requested domain |
Returns : |
the GVirDomain, or NULL. The returned
object should be unreffed with g_object_unref() when no longer needed. [transfer full]
|
GVirInterface * gvir_connection_find_interface_by_mac (GVirConnection *conn,const gchar *macaddr);
GVirNetwork * gvir_connection_find_network_by_name (GVirConnection *conn,const gchar *name);
GVirNetworkFilter * gvir_connection_find_network_filter_by_name (GVirConnection *conn,const gchar *name);
GVirStoragePool * gvir_connection_find_storage_pool_by_name (GVirConnection *conn,const gchar *name);
|
a GVirConnection |
|
name of the requested storage pool |
Returns : |
the GVirStoragePool, or NULL. The returned
object should be unreffed with g_object_unref() when no longer needed. [transfer full]
|
GVirConfigCapabilities * gvir_connection_get_capabilities (GVirConnection *conn,GError **err);
|
a GVirConnection |
|
return location for any GError |
Returns : |
a GVirConfigCapabilities or NULL. The
returned object should be unreffed with g_object_unref() when no longer
needed. [transfer full]
|
void gvir_connection_get_capabilities_async (GVirConnection *conn,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
|
a GVirConnection |
|
cancellation object. [allow-none][transfer none] |
|
completion callback. [scope async] |
|
opaque data for callback. [closure] |
GVirConfigCapabilities * gvir_connection_get_capabilities_finish (GVirConnection *conn,GAsyncResult *result,GError **err);
|
a GVirConnection |
|
async method result. [transfer none] |
Returns : |
a GVirConfigCapabilities or NULL. The
returned object should be unreffed with g_object_unref() when no longer
needed. [transfer full]
|
GVirDomain * gvir_connection_get_domain (GVirConnection *conn,const gchar *uuid);
|
a GVirConnection |
|
uuid string of the requested domain |
Returns : |
the GVirDomain, or NULL. The returned
object should be unreffed with g_object_unref() when no longer needed. [transfer full]
|
GList * gvir_connection_get_domains (GVirConnection *conn);
Gets a list of the domains available through conn.
|
a GVirConnection |
Returns : |
List
of GVirDomain. The returned list should be freed with g_list_free(),
after its elements have been unreffed with g_object_unref(). [element-type LibvirtGObject.Domain][transfer full]
|
gchar * gvir_connection_get_hypervisor_name (GVirConnection *conn,GError **err);
Get name of current hypervisor used.
|
a GVirConnection |
|
return location for any GError |
Returns : |
new string that should be freed when no longer needed, or NULL upon error. |
GVirInterface * gvir_connection_get_interface (GVirConnection *conn,const gchar *name);
GVirNetwork * gvir_connection_get_network (GVirConnection *conn,const gchar *uuid);
GVirNetworkFilter * gvir_connection_get_network_filter (GVirConnection *conn,const gchar *uuid);
GList * gvir_connection_get_network_filters (GVirConnection *conn);
GVirNodeDevice * gvir_connection_get_node_device (GVirConnection *conn,const gchar *name);
GList * gvir_connection_get_node_devices (GVirConnection *conn);
GVirNodeInfo * gvir_connection_get_node_info (GVirConnection *conn,GError **err);
|
a GVirConnection |
|
return location for any GError |
Returns : |
the info, or NULL if an error occurred. The
returned object should be unreffed with g_object_unref() when no longer
needed. [transfer full]
|
GVirSecret * gvir_connection_get_secret (GVirConnection *conn,const gchar *uuid);
GVirStoragePool * gvir_connection_get_storage_pool (GVirConnection *conn,const gchar *uuid);
|
a GVirConnection |
|
uuid string of the requested storage pool |
Returns : |
the GVirStoragePool, or NULL. The returned
object should be unreffed with g_object_unref() when no longer needed. [transfer full]
|
GList * gvir_connection_get_storage_pools (GVirConnection *conn);
Gets a list of the storage pools available through conn.
|
a GVirConnection |
Returns : |
List
of GVirStoragePool. The returned list should be freed with
g_list_free(), after its elements have been unreffed with
g_object_unref(). [element-type LibvirtGObject.StoragePool][transfer full]
|
GVirStream * gvir_connection_get_stream (GVirConnection *conn,guint flags);
|
a GVirConnection |
|
flags to use for the stream |
Returns : |
a GVirStream stream, or NULL.The returned
object should be unreffed with g_object_unref() when no longer needed. [transfer full]
|
gulong gvir_connection_get_version (GVirConnection *conn,GError **err);
Get version of current hypervisor used.
|
a GVirConnection |
|
return location for any GError |
Returns : |
version on success, 0 otherwise and err set. |
gboolean gvir_connection_open (GVirConnection *conn,GCancellable *cancellable,GError **err);
|
a GVirConnection |
|
cancellation object. [allow-none][transfer none] |
void gvir_connection_open_async (GVirConnection *conn,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
|
a GVirConnection |
|
cancellation object. [allow-none][transfer none] |
|
completion callback. [scope async] |
|
opaque data for callback. [closure] |
gboolean gvir_connection_open_finish (GVirConnection *conn,GAsyncResult *result,GError **err);
|
a GVirConnection |
|
async method result. [transfer none] |
gboolean gvir_connection_open_read_only (GVirConnection *conn,GCancellable *cancellable,GError **err);
void gvir_connection_open_read_only_async (GVirConnection *conn,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
|
a GVirConnection |
|
cancellation object. [allow-none][transfer none] |
|
completion callback. [scope async] |
|
opaque data for callback. [closure] |
gboolean gvir_connection_open_read_only_finish (GVirConnection *conn,GAsyncResult *result,GError **err);
|
a GVirConnection |
|
async method result. [transfer none] |
gboolean gvir_connection_restore_domain_from_file (GVirConnection *conn,gchar *filename,GVirConfigDomain *custom_conf,guint flags,GError **err);
Restores the domain saved with gvir_domain_save_to_file
|
a GVirConnection |
|
path to input file |
|
configuration for domain or NULL. [allow-none] |
|
the flags |
Returns : |
TRUE on success, FALSE otherwise |
void gvir_connection_restore_domain_from_file_async (GVirConnection *conn,gchar *filename,GVirConfigDomain *custom_conf,guint flags,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronous variant of gvir_connection_restore_domain_from_file
|
a GVirConnection |
|
path to input file |
|
configuration for domain. [allow-none] |
|
the flags |
|
cancellation object. [allow-none][transfer none] |
|
completion callback. [scope async] |
|
opaque data for callback. [closure] |
gboolean gvir_connection_restore_domain_from_file_finish (GVirConnection *conn,GAsyncResult *result,GError **err);
Finishes the operation started by gvir_restore_domain_from_file_async.
|
a GVirConnection |
|
async method result. [transfer none] |
|
Place-holder for possible errors |
Returns : |
TRUE if domain was restored successfully, FALSE otherwise. |
GVirDomain * gvir_connection_start_domain (GVirConnection *conn,GVirConfigDomain *conf,guint flags,GError **err);
Start a new transient domain without persistent configuration. The returned domain will initially be running.
|
a GVirConnection on which to create the domain |
|
the configuration for the new domain |
Returns : |
the newly created domain, or NULL if an error
occurred. The returned object should be unreffed with g_object_unref()
when no longer needed. [transfer full]
|
"handle" property "handle" GVirConnectionHandle* : Read / Write / Construct Only
The connection handle.
"connection-closed" signalvoid user_function (GVirConnection *gvirconnection,
gpointer user_data) : Run First
"connection-opened" signalvoid user_function (GVirConnection *gvirconnection,
gpointer user_data) : Run First
"domain-added" signalvoid user_function (GVirConnection *gvirconnection,
GVirDomain *arg1,
gpointer user_data) : Run First
"domain-removed" signalvoid user_function (GVirConnection *gvirconnection,
GVirDomain *arg1,
gpointer user_data) : Run First