]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
LXC from native: map lxc.arch to /domain/os/type@arch
authorCédric Bosdonnat <cbosdonnat@suse.com>
Wed, 5 Feb 2014 14:10:13 +0000 (15:10 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 12 Feb 2014 17:52:46 +0000 (17:52 +0000)
src/lxc/lxc_native.c
tests/lxcconf2xmldata/lxcconf2xml-simple.config
tests/lxcconf2xmldata/lxcconf2xml-simple.xml

index 45cc2891733b6f02b5335d3f3fdfa6fdd9625a29..3d68f167675bb8133ccef0f6c23da72c179f83ff 100644 (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;
 
index f75e8fc3d83a804c4e999691de1efa0bfdd1beac..b90abc11a0577ee26291858497db0586e0451fc8 100644 (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
index 711e0d91d5053e65554784a71beb762dc4a1d4e2..6ec0f17ad7660c009ae4961f5f8eb9d2ba54671d 100644 (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'/>