LXC from native: map lxc.arch to /domain/os/type@arch

This commit is contained in:
Cédric Bosdonnat 2014-02-05 15:10:13 +01:00 committed by Daniel P. Berrange
parent 5b8bfb0276
commit 0f13a525d2
3 changed files with 11 additions and 1 deletions

View File

@ -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;

View File

@ -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

View File

@ -5,7 +5,7 @@
<currentMemory unit='KiB'>0</currentMemory>
<vcpu placement='static' current='0'>1</vcpu>
<os>
<type>exe</type>
<type arch='i686'>exe</type>
<init>/sbin/init</init>
</os>
<clock offset='utc'/>