GVirSandboxContext

GVirSandboxContext — Application sandbox context

Synopsis

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

#define             GVIR_SANDBOX_TYPE_CONTEXT_HANDLE
struct              GVirSandboxContext;
struct              GVirSandboxContextClass;
GVirSandboxConfig * gvir_sandbox_context_get_config     (GVirSandboxContext *ctxt);
void                gvir_sandbox_context_set_autodestroy
                                                        (GVirSandboxContext *ctxt,
                                                         gboolean state);
gboolean            gvir_sandbox_context_get_autodestroy
                                                        (GVirSandboxContext *ctxt);
gboolean            gvir_sandbox_context_start          (GVirSandboxContext *ctxt,
                                                         GError **error);
gboolean            gvir_sandbox_context_stop           (GVirSandboxContext *ctxt,
                                                         GError **error);
gboolean            gvir_sandbox_context_attach         (GVirSandboxContext *ctxt,
                                                         GError **error);
gboolean            gvir_sandbox_context_detach         (GVirSandboxContext *ctxt,
                                                         GError **error);
GVirDomain *        gvir_sandbox_context_get_domain     (GVirSandboxContext *ctxt,
                                                         GError **error);
GVirConnection *    gvir_sandbox_context_get_connection (GVirSandboxContext *ctxt);
GVirSandboxConsole * gvir_sandbox_context_get_log_console
                                                        (GVirSandboxContext *ctxt,
                                                         GError **error);
GVirSandboxConsole * gvir_sandbox_context_get_shell_console
                                                        (GVirSandboxContext *ctxt,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GVirSandboxContext
         +----GVirSandboxContextGraphical
         +----GVirSandboxContextInteractive
         +----GVirSandboxContextService

Properties

  "autodestroy"              gboolean              : Read / Write
  "config"                   GVirSandboxConfig*    : Read / Write / Construct Only
  "connection"               GVirConnection*       : Read / Write / Construct Only
  "domain"                   GVirDomain*           : Read

Description

Provides a base class for implementing console based application sandboxes

The GVirSandboxContext object takes a GVirSandboxConfig instance, passing it to GVirSandboxBuilder instance to create a virtual machine, and then provides access to a GVirSandboxConsole instance for interacting with the sandboxed application's stdio.

Details

GVIR_SANDBOX_TYPE_CONTEXT_HANDLE

#define GVIR_SANDBOX_TYPE_CONTEXT_HANDLE      (gvir_sandbox_context_handle_get_type ())

struct GVirSandboxContext

struct GVirSandboxContext;

struct GVirSandboxContextClass

struct GVirSandboxContextClass {
    GObjectClass parent_class;

    gboolean (*prestart)(GVirSandboxContext *ctxt,
                         const gchar *configdir,
                         GError **error);

    /* XXX padding */
};

gvir_sandbox_context_get_config ()

GVirSandboxConfig * gvir_sandbox_context_get_config     (GVirSandboxContext *ctxt);

Retrieves the sandbox configuration

ctxt :

the sandbox context. [transfer none]

Returns :

the current configuration. [transfer full]

gvir_sandbox_context_set_autodestroy ()

void                gvir_sandbox_context_set_autodestroy
                                                        (GVirSandboxContext *ctxt,
                                                         gboolean state);

Control whether the sandbox should be automatically destroyed when the client which started it closes its connection to libvirtd. If state is true, then the sandbox will be automatically destroyed upon client close/exit

ctxt :

the sandbox context. [transfer none]

state :

the autodestroy flag state

gvir_sandbox_context_get_autodestroy ()

gboolean            gvir_sandbox_context_get_autodestroy
                                                        (GVirSandboxContext *ctxt);

Determine whether the sandbox will be automatically destroyed when the client which started it closes its connection to libvirtd

ctxt :

the sandbox context. [transfer none]

Returns :

the autodestroy flag state

gvir_sandbox_context_start ()

gboolean            gvir_sandbox_context_start          (GVirSandboxContext *ctxt,
                                                         GError **error);

gvir_sandbox_context_stop ()

gboolean            gvir_sandbox_context_stop           (GVirSandboxContext *ctxt,
                                                         GError **error);

gvir_sandbox_context_attach ()

gboolean            gvir_sandbox_context_attach         (GVirSandboxContext *ctxt,
                                                         GError **error);

gvir_sandbox_context_detach ()

gboolean            gvir_sandbox_context_detach         (GVirSandboxContext *ctxt,
                                                         GError **error);

gvir_sandbox_context_get_domain ()

GVirDomain *        gvir_sandbox_context_get_domain     (GVirSandboxContext *ctxt,
                                                         GError **error);

Retrieves the sandbox domain (if running)

ctxt :

the sandbox context. [transfer none]

Returns :

the current domain or NULL. [transfer full]

gvir_sandbox_context_get_connection ()

GVirConnection *    gvir_sandbox_context_get_connection (GVirSandboxContext *ctxt);

Retrieves the sandbox connection

ctxt :

the sandbox context. [transfer none]

Returns :

the current connection or NULL. [transfer full]

gvir_sandbox_context_get_log_console ()

GVirSandboxConsole * gvir_sandbox_context_get_log_console
                                                        (GVirSandboxContext *ctxt,
                                                         GError **error);

ctxt :

the sandbox context. [transfer none]

Returns :

the sandbox console (or NULL). [transfer full][allow-none]

gvir_sandbox_context_get_shell_console ()

GVirSandboxConsole * gvir_sandbox_context_get_shell_console
                                                        (GVirSandboxContext *ctxt,
                                                         GError **error);

ctxt :

the sandbox context. [transfer none]

Returns :

the sandbox console (or NULL). [transfer full][allow-none]

Property Details

The "autodestroy" property

  "autodestroy"              gboolean              : Read / Write

Automatically destroy sandbox on exit.

Default value: TRUE


The "config" property

  "config"                   GVirSandboxConfig*    : Read / Write / Construct Only

The sandbox configuration.


The "connection" property

  "connection"               GVirConnection*       : Read / Write / Construct Only

The sandbox connection.


The "domain" property

  "domain"                   GVirDomain*           : Read

The sandbox domain.

See Also

GVirSandboxContextGraphical