Commit 3aed3ee2 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Fix debug in container based guests & remove memballoon

parent 63b0d64e
......@@ -114,6 +114,21 @@ static void gvir_sandbox_builder_container_finalize(GObject *object)
}
static gchar *gvir_sandbox_builder_container_cmdline(GVirSandboxConfig *config G_GNUC_UNUSED)
{
GString *str = g_string_new("");
gchar *ret;
/* Now kernel args */
if (getenv("LIBVIRT_SANDBOX_DEBUG"))
g_string_append(str, "debug");
ret = str->str;
g_string_free(str, FALSE);
return ret;
}
static gboolean gvir_sandbox_builder_container_construct_basic(GVirSandboxBuilder *builder,
GVirSandboxConfig *config,
const gchar *configdir,
......@@ -139,12 +154,15 @@ static gboolean gvir_sandbox_builder_container_construct_os(GVirSandboxBuilder *
GVirConfigDomain *domain,
GError **error)
{
gchar *cmdline = NULL;
GVirConfigDomainOs *os;
if (!GVIR_SANDBOX_BUILDER_CLASS(gvir_sandbox_builder_container_parent_class)->
construct_os(builder, config, configdir, cleaner, domain, error))
return FALSE;
cmdline = gvir_sandbox_builder_container_cmdline(config);
os = gvir_config_domain_os_new();
gvir_config_domain_os_set_os_type(os,
GVIR_CONFIG_DOMAIN_OS_TYPE_EXE);
......@@ -152,8 +170,11 @@ static gboolean gvir_sandbox_builder_container_construct_os(GVirSandboxBuilder *
gvir_sandbox_config_get_arch(config));
gvir_config_domain_os_set_init(os,
LIBEXECDIR "/libvirt-sandbox-init-lxc");
gvir_config_domain_os_set_cmdline(os, cmdline);
gvir_config_domain_set_os(domain, os);
g_free(cmdline);
return TRUE;
}
......@@ -181,7 +202,6 @@ static gboolean gvir_sandbox_builder_container_construct_devices(GVirSandboxBuil
{
GVirConfigDomainFilesys *fs;
GVirConfigDomainInterfaceNetwork *iface;
GVirConfigDomainMemballoon *ball;
GList *tmp = NULL, *mounts = NULL, *networks = NULL;
if (!GVIR_SANDBOX_BUILDER_CLASS(gvir_sandbox_builder_container_parent_class)->
......@@ -250,14 +270,6 @@ static gboolean gvir_sandbox_builder_container_construct_devices(GVirSandboxBuil
}
ball = gvir_config_domain_memballoon_new();
gvir_config_domain_memballoon_set_model(ball,
GVIR_CONFIG_DOMAIN_MEMBALLOON_MODEL_NONE);
gvir_config_domain_add_device(domain,
GVIR_CONFIG_DOMAIN_DEVICE(ball));
g_object_unref(ball);
if (GVIR_SANDBOX_IS_CONFIG_GRAPHICAL(config)) {
g_set_error(error, GVIR_SANDBOX_BUILDER_CONTAINER_ERROR, 0,
"%s", "Graphical sandboxes are not supported for containers");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment