From: Cédric Bosdonnat Date: Wed, 5 Feb 2014 14:10:13 +0000 (+0100) Subject: LXC from native: map lxc.arch to /domain/os/type@arch X-Git-Tag: v1.2.2-rc1~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f13a525d293f4d5342ce5295f2272ba835bd233;p=thirdparty%2Flibvirt.git LXC from native: map lxc.arch to /domain/os/type@arch --- diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 45cc289173..3d68f16767 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -797,6 +797,15 @@ lxcParseConfigString(const char *config) if (VIR_STRDUP(vmdef->os.type, "exe") < 0) goto error; + if ((value = virConfGetValue(properties, "lxc.arch")) && value->str) { + virArch arch = virArchFromString(value->str); + if (arch == VIR_ARCH_NONE && STREQ(value->str, "x86")) + arch = VIR_ARCH_I686; + else if (arch == VIR_ARCH_NONE && STREQ(value->str, "amd64")) + arch = VIR_ARCH_X86_64; + vmdef->os.arch = arch; + } + if (VIR_STRDUP(vmdef->os.init, "/sbin/init") < 0) goto error; diff --git a/tests/lxcconf2xmldata/lxcconf2xml-simple.config b/tests/lxcconf2xmldata/lxcconf2xml-simple.config index f75e8fc3d8..b90abc11a0 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-simple.config +++ b/tests/lxcconf2xmldata/lxcconf2xml-simple.config @@ -14,6 +14,7 @@ lxc.mount.entry = tmpfs run tmpfs size=8m,mode=0755,nodev,nosuid 0 0 lxc.mount.entry = /etc/resolv.conf etc/resolv.conf none bind,ro 0 0 lxc.rootfs = /var/lib/lxc/migrate_test/rootfs lxc.utsname = migrate_test +lxc.arch = x86 lxc.autodev=1 lxc.tty = 2 lxc.pts = 1024 diff --git a/tests/lxcconf2xmldata/lxcconf2xml-simple.xml b/tests/lxcconf2xmldata/lxcconf2xml-simple.xml index 711e0d91d5..6ec0f17ad7 100644 --- a/tests/lxcconf2xmldata/lxcconf2xml-simple.xml +++ b/tests/lxcconf2xmldata/lxcconf2xml-simple.xml @@ -5,7 +5,7 @@ 0 1 - exe + exe /sbin/init