GVirSandboxConfigInitrd

GVirSandboxConfigInitrd — Kernel ramdisk configuration details

Functions

Properties

gchar * init Read / Write
gchar * kmoddir Read / Write
gchar * kver Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GVirSandboxConfigInitrd

Includes

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

Description

Provides an object to store information about a kernel ramdisk

The GVirSandboxConfigInitrd object stores the information required to build a kernel ramdisk to use when booting a virtual machine as a sandbox.

Functions

gvir_sandbox_config_initrd_new ()

GVirSandboxConfigInitrd *
gvir_sandbox_config_initrd_new (void);

Create a new initrd config

Returns

a new sandbox initrd object.

[transfer full]


gvir_sandbox_config_initrd_set_kver ()

void
gvir_sandbox_config_initrd_set_kver (GVirSandboxConfigInitrd *config,
                                     const gchar *version);

Sets the host kernel version to use for populating the initrd with modules. This defaults to the currently running kernel version

Parameters

config

the sandbox initrd config.

[transfer none]

version

the kernel version.

[transfer none]

gvir_sandbox_config_initrd_get_kver ()

const gchar *
gvir_sandbox_config_initrd_get_kver (GVirSandboxConfigInitrd *config);

Retrieves the path of the kver binary

Parameters

config

the sandbox initrd config.

[transfer none]

Returns

the kver binary path.

[transfer none]


gvir_sandbox_config_initrd_set_kmoddir ()

void
gvir_sandbox_config_initrd_set_kmoddir
                               (GVirSandboxConfigInitrd *config,
                                const gchar *kmoddir);

Sets the full path to where the kernel modules will be looked up

Parameters

config

the sandbox initrd config.

[transfer none]

kmoddir

the full path to the kernel modules directory.

[transfer none]

gvir_sandbox_config_initrd_get_kmoddir ()

const gchar *
gvir_sandbox_config_initrd_get_kmoddir
                               (GVirSandboxConfigInitrd *config);

Retrieves the current kernel modules directory

Parameters

config

the full path to the kernel modules directory.

[transfer none]

Returns

the full path to the kernel modules directory.

[transfer none]


gvir_sandbox_config_initrd_set_init ()

void
gvir_sandbox_config_initrd_set_init (GVirSandboxConfigInitrd *config,
                                     const gchar *hostpath);

Sets the host binary to be used as the init program inside the initrd. This defaults to /usr/bin/libvirt-sandbox-init-qemu

Parameters

config

the sandbox initrd config.

[transfer none]

hostpath

the init binary path.

[transfer none]

gvir_sandbox_config_initrd_get_init ()

const gchar *
gvir_sandbox_config_initrd_get_init (GVirSandboxConfigInitrd *config);

Retrieves the path of the init binary

Parameters

config

the sandbox initrd config.

[transfer none]

Returns

the init binary path.

[transfer none]


gvir_sandbox_config_initrd_add_module ()

void
gvir_sandbox_config_initrd_add_module (GVirSandboxConfigInitrd *config,
                                       const gchar *modname);

Request that the kernel module modname is included in the initrd, along with any depedent modules

Parameters

config

the sandbox initrd config.

[transfer none]

modname

the kernel module name.

[transfer none]

gvir_sandbox_config_initrd_get_modules ()

GList *
gvir_sandbox_config_initrd_get_modules
                               (GVirSandboxConfigInitrd *config);

Retrieves the list of all modules

Parameters

config

the sandbox initrd config.

[transfer none]

Returns

the module names.

[transfer container][element-type utf8]

Types and Values

GVIR_SANDBOX_TYPE_CONFIG_INITRD_HANDLE

#define GVIR_SANDBOX_TYPE_CONFIG_INITRD_HANDLE      (gvir_sandbox_config_initrd_handle_get_type ())

struct GVirSandboxConfigInitrd

struct GVirSandboxConfigInitrd;

struct GVirSandboxConfigInitrdClass

struct GVirSandboxConfigInitrdClass {
    GObjectClass parent_class;

    gpointer padding[LIBVIRT_SANDBOX_CLASS_PADDING];
};

GVirSandboxConfigInitrdPrivate

typedef struct _GVirSandboxConfigInitrdPrivate GVirSandboxConfigInitrdPrivate;

Property Details

The “init” property

  “init”                     gchar *

The host init path.

Flags: Read / Write

Default value: NULL


The “kmoddir” property

  “kmoddir”                  gchar *

Kernel modules directory.

Flags: Read / Write

Default value: NULL


The “kver” property

  “kver”                     gchar *

The host kernel version.

Flags: Read / Write

Default value: NULL