GVirConnection

GVirConnection

Synopsis

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);
GVirDomain *        gvir_connection_get_domain          (GVirConnection *conn,
                                                         const gchar *uuid);
GList *             gvir_connection_get_domains         (GVirConnection *conn);
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);
gboolean            gvir_connection_is_open             (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);
GVirDomain *        gvir_connection_start_domain        (GVirConnection *conn,
                                                         GVirConfigDomain *conf,
                                                         guint flags,
                                                         GError **err);

Object Hierarchy

  GObject
   +----GVirConnection
  GBoxed
   +----GVirNodeInfo

Properties

  "handle"                   GVirConnectionHandle*  : Read / Write / Construct Only
  "uri"                      gchar*                : Read / Write / Construct Only

Signals

  "connection-closed"                              : Run First
  "connection-opened"                              : Run First
  "domain-added"                                   : Run First
  "domain-removed"                                 : Run First

Description

Details

struct GVirConnection

struct GVirConnection;

struct GVirConnectionClass

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

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 */
};

gvir_connection_close ()

void                gvir_connection_close               (GVirConnection *conn);

gvir_connection_create_domain ()

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.

conn :

the connection on which to create the domain

conf :

the configuration for the new domain

Returns :

the newly created domain. [transfer full]

gvir_connection_create_storage_pool ()

GVirStoragePool *   gvir_connection_create_storage_pool (GVirConnection *conn,
                                                         GVirConfigStoragePool *conf,
                                                         guint flags,
                                                         GError **err);

conn :

the connection on which to create the pool

conf :

the configuration for the new storage pool

flags :

the flags

err :

return location for any GError

Returns :

the newly created storage pool. [transfer full]

gvir_connection_fetch_domains ()

gboolean            gvir_connection_fetch_domains       (GVirConnection *conn,
                                                         GCancellable *cancellable,
                                                         GError **err);

conn :

the connection

cancellable :

cancellation object. [allow-none][transfer none]

gvir_connection_fetch_domains_async ()

void                gvir_connection_fetch_domains_async (GVirConnection *conn,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

conn :

the connection

cancellable :

cancellation object. [allow-none][transfer none]

callback :

completion callback. [scope async]

user_data :

opaque data for callback. [closure]

gvir_connection_fetch_domains_finish ()

gboolean            gvir_connection_fetch_domains_finish
                                                        (GVirConnection *conn,
                                                         GAsyncResult *result,
                                                         GError **err);

conn :

the connection

result :

async method result. [transfer none]

gvir_connection_fetch_storage_pools ()

gboolean            gvir_connection_fetch_storage_pools (GVirConnection *conn,
                                                         GCancellable *cancellable,
                                                         GError **err);

conn :

the connection

cancellable :

cancellation object. [allow-none][transfer none]

gvir_connection_fetch_storage_pools_async ()

void                gvir_connection_fetch_storage_pools_async
                                                        (GVirConnection *conn,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

conn :

the connection

cancellable :

cancellation object. [allow-none][transfer none]

callback :

completion callback. [scope async]

user_data :

opaque data for callback. [closure]

gvir_connection_fetch_storage_pools_finish ()

gboolean            gvir_connection_fetch_storage_pools_finish
                                                        (GVirConnection *conn,
                                                         GAsyncResult *result,
                                                         GError **err);

conn :

the connection

result :

async method result. [transfer none]

gvir_connection_find_domain_by_id ()

GVirDomain *        gvir_connection_find_domain_by_id   (GVirConnection *conn,
                                                         gint id);

id :

id of the requested domain

Returns :

the GVirDomain, or NULL. [transfer full]

gvir_connection_find_domain_by_name ()

GVirDomain *        gvir_connection_find_domain_by_name (GVirConnection *conn,
                                                         const gchar *name);

name :

name of the requested domain

Returns :

the GVirDomain, or NULL. [transfer full]

gvir_connection_find_interface_by_mac ()

GVirInterface *     gvir_connection_find_interface_by_mac
                                                        (GVirConnection *conn,
                                                         const gchar *macaddr);

gvir_connection_find_network_by_name ()

GVirNetwork *       gvir_connection_find_network_by_name
                                                        (GVirConnection *conn,
                                                         const gchar *name);

gvir_connection_find_network_filter_by_name ()

GVirNetworkFilter * gvir_connection_find_network_filter_by_name
                                                        (GVirConnection *conn,
                                                         const gchar *name);

gvir_connection_find_storage_pool_by_name ()

GVirStoragePool *   gvir_connection_find_storage_pool_by_name
                                                        (GVirConnection *conn,
                                                         const gchar *name);

name :

name of the requested storage pool

Returns :

the GVirStoragePool, or NULL. [transfer full]

gvir_connection_get_domain ()

GVirDomain *        gvir_connection_get_domain          (GVirConnection *conn,
                                                         const gchar *uuid);

uuid :

uuid string of the requested domain

Returns :

the GVirDomain, or NULL. [transfer full]

gvir_connection_get_domains ()

GList *             gvir_connection_get_domains         (GVirConnection *conn);

Returns :

List of GVirDomain. [element-type LibvirtGObject.Domain][transfer full]

gvir_connection_get_interface ()

GVirInterface *     gvir_connection_get_interface       (GVirConnection *conn,
                                                         const gchar *name);

gvir_connection_get_interfaces ()

GList *             gvir_connection_get_interfaces      (GVirConnection *conn);

gvir_connection_get_network ()

GVirNetwork *       gvir_connection_get_network         (GVirConnection *conn,
                                                         const gchar *uuid);

gvir_connection_get_network_filter ()

GVirNetworkFilter * gvir_connection_get_network_filter  (GVirConnection *conn,
                                                         const gchar *uuid);

gvir_connection_get_network_filters ()

GList *             gvir_connection_get_network_filters (GVirConnection *conn);

gvir_connection_get_networks ()

GList *             gvir_connection_get_networks        (GVirConnection *conn);

gvir_connection_get_node_device ()

GVirNodeDevice *    gvir_connection_get_node_device     (GVirConnection *conn,
                                                         const gchar *name);

gvir_connection_get_node_devices ()

GList *             gvir_connection_get_node_devices    (GVirConnection *conn);

gvir_connection_get_node_info ()

GVirNodeInfo *      gvir_connection_get_node_info       (GVirConnection *conn,
                                                         GError **err);

conn :

the connection

err :

return location for any GError

Returns :

the info. [transfer full]

gvir_connection_get_secret ()

GVirSecret *        gvir_connection_get_secret          (GVirConnection *conn,
                                                         const gchar *uuid);

gvir_connection_get_secrets ()

GList *             gvir_connection_get_secrets         (GVirConnection *conn);

gvir_connection_get_storage_pool ()

GVirStoragePool *   gvir_connection_get_storage_pool    (GVirConnection *conn,
                                                         const gchar *uuid);

uuid :

uuid string of the requested storage pool

Returns :

the GVirStoragePool, or NULL. [transfer full]

gvir_connection_get_storage_pools ()

GList *             gvir_connection_get_storage_pools   (GVirConnection *conn);

Returns :

List of GVirStoragePool. [element-type LibvirtGObject.StoragePool][transfer full]

gvir_connection_get_stream ()

GVirStream *        gvir_connection_get_stream          (GVirConnection *conn,
                                                         guint flags);

flags :

flags to use for the stream

Returns :

a GVirStream stream, or NULL. [transfer full]

gvir_connection_get_uri ()

const gchar *       gvir_connection_get_uri             (GVirConnection *conn);

gvir_connection_is_open ()

gboolean            gvir_connection_is_open             (GVirConnection *conn);

gvir_connection_new ()

GVirConnection *    gvir_connection_new                 (const char *uri);

gvir_connection_open ()

gboolean            gvir_connection_open                (GVirConnection *conn,
                                                         GCancellable *cancellable,
                                                         GError **err);

conn :

the connection

cancellable :

cancellation object. [allow-none][transfer none]

gvir_connection_open_async ()

void                gvir_connection_open_async          (GVirConnection *conn,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

conn :

the connection

cancellable :

cancellation object. [allow-none][transfer none]

callback :

completion callback. [scope async]

user_data :

opaque data for callback. [closure]

gvir_connection_open_finish ()

gboolean            gvir_connection_open_finish         (GVirConnection *conn,
                                                         GAsyncResult *result,
                                                         GError **err);

conn :

the connection

result :

async method result. [transfer none]

gvir_connection_start_domain ()

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.

conn :

the connection on which to create the domain

conf :

the configuration for the new domain

Returns :

the newly created domain. [transfer full]

Property Details

The "handle" property

  "handle"                   GVirConnectionHandle*  : Read / Write / Construct Only

The connection handle.


The "uri" property

  "uri"                      gchar*                : Read / Write / Construct Only

The connection URI.

Default value: NULL

Signal Details

The "connection-closed" signal

void                user_function                      (GVirConnection *gvirconnection,
                                                        gpointer        user_data)           : Run First

The "connection-opened" signal

void                user_function                      (GVirConnection *gvirconnection,
                                                        gpointer        user_data)           : Run First

The "domain-added" signal

void                user_function                      (GVirConnection *gvirconnection,
                                                        GVirDomain     *arg1,
                                                        gpointer        user_data)           : Run First

The "domain-removed" signal

void                user_function                      (GVirConnection *gvirconnection,
                                                        GVirDomain     *arg1,
                                                        gpointer        user_data)           : Run First