GVirSandboxBuilder

GVirSandboxBuilder — Sandbox construction base class

Functions

Properties

GVirConnection * connection Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── GVirSandboxBuilder
        ├── GVirSandboxBuilderContainer
        ╰── GVirSandboxBuilderMachine

Includes

#include <libvirt-sandbox/libvirt-sandbox.h>

Description

Provides a base class for constructing sandboxes

The GVirSandboxBuilder objects provides the basic framework for creating GVirDomain instances from GVirSandboxConfig instances.

Functions

gvir_sandbox_builder_for_connection ()

GVirSandboxBuilder *
gvir_sandbox_builder_for_connection (GVirConnection *connection,
                                     GError **error);

Find and instantiate a suitable builder for sandboxes to be hosted under the connection .

Parameters

connection

the connection to host the sandbox.

[transfer none]

error

the error.

[out]

Returns

a new builder or NULL.

[transfer full]


gvir_sandbox_builder_get_connection ()

GVirConnection *
gvir_sandbox_builder_get_connection (GVirSandboxBuilder *builder);

Retrieves the sandbox connection

Parameters

builder

the sandbox builder.

[transfer none]

Returns

the current connection.

[transfer full]


gvir_sandbox_builder_construct ()

GVirConfigDomain *
gvir_sandbox_builder_construct (GVirSandboxBuilder *builder,
                                GVirSandboxConfig *config,
                                const gchar *statedir,
                                GError **error);

Create a domain configuration from the sandbox configuration

Parameters

builder

the sandbox builder.

[transfer none]

config

the sandbox configuration.

[transfer none]

error

the error location.

[out]

Returns

the newly built domain configuration.

[transfer full]


gvir_sandbox_builder_clean_post_start ()

gboolean
gvir_sandbox_builder_clean_post_start (GVirSandboxBuilder *builder,
                                       GVirSandboxConfig *config,
                                       const gchar *statedir,
                                       GError **error);

Cleanup temporary files which are not required once the sandbox has been started.

Parameters

builder

the sandbox builder.

[transfer none]

config

the sandbox configuration.

[transfer none]

error

the error location.

[out]

Returns

TRUE on success, FALSE on error


gvir_sandbox_builder_clean_post_stop ()

gboolean
gvir_sandbox_builder_clean_post_stop (GVirSandboxBuilder *builder,
                                      GVirSandboxConfig *config,
                                      const gchar *statedir,
                                      GError **error);

Cleanup temporary files which are not required once the sandbox has been started.

Parameters

builder

the sandbox builder.

[transfer none]

config

the sandbox configuration.

[transfer none]

error

the error location.

[out]

Returns

TRUE on success, FALSE on error

Types and Values

GVIR_SANDBOX_TYPE_BUILDER_HANDLE

#define GVIR_SANDBOX_TYPE_BUILDER_HANDLE      (gvir_sandbox_builder_handle_get_type ())

struct GVirSandboxBuilder

struct GVirSandboxBuilder;

struct GVirSandboxBuilderClass

struct GVirSandboxBuilderClass {
    GObjectClass parent_class;

    gboolean (*construct_basic)(GVirSandboxBuilder *builder,
                                GVirSandboxConfig *config,
                                const gchar *statedir,
                                GVirConfigDomain *domain,
                                GError **error);
    gboolean (*construct_os)(GVirSandboxBuilder *builder,
                             GVirSandboxConfig *config,
                             const gchar *statedir,
                             GVirConfigDomain *domain,
                             GError **error);
    gboolean (*construct_features)(GVirSandboxBuilder *builder,
                                   GVirSandboxConfig *config,
                                   const gchar *statedir,
                                   GVirConfigDomain *domain,
                                   GError **error);
    gboolean (*construct_devices)(GVirSandboxBuilder *builder,
                                  GVirSandboxConfig *config,
                                  const gchar *statedir,
                                  GVirConfigDomain *domain,
                                  GError **error);
    gboolean (*construct_security)(GVirSandboxBuilder *builder,
                                   GVirSandboxConfig *config,
                                   const gchar *statedir,
                                   GVirConfigDomain *domain,
                                   GError **error);
    gboolean (*construct_domain)(GVirSandboxBuilder *builder,
                                 GVirSandboxConfig *config,
                                 const gchar *statedir,
                                 GVirConfigDomain *domain,
                                 GError **error);

    gboolean (*clean_post_start)(GVirSandboxBuilder *builder,
                                 GVirSandboxConfig *config,
                                 const gchar *statedir,
                                 GError **error);
    gboolean (*clean_post_stop)(GVirSandboxBuilder *builder,
                                GVirSandboxConfig *config,
                                const gchar *statedir,
                                GError **error);
    const gchar *(*get_disk_prefix)(GVirSandboxBuilder *builder,
                                    GVirSandboxConfig *config,
                                    GVirSandboxConfigDisk *disk);
    GList *(*get_files_to_copy)(GVirSandboxBuilder *builder,
                                GVirSandboxConfig *config);

    gpointer padding[LIBVIRT_SANDBOX_CLASS_PADDING];
};

GVirSandboxBuilderPrivate

typedef struct _GVirSandboxBuilderPrivate GVirSandboxBuilderPrivate;

Property Details

The “connection” property

  “connection”               GVirConnection *

The sandbox connection.

Flags: Read / Write / Construct Only

See Also

GVirSandboxBuilderContainer GVirSandboxBuilderMachine