]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
output lxc.arch as i686 for PER_LINUX32
authorDwight Engen <dwight.engen@oracle.com>
Mon, 28 Apr 2014 20:51:06 +0000 (16:51 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 28 Apr 2014 21:18:00 +0000 (16:18 -0500)
When outputing the lxc.arch setting, use i686 instead of x86 since the
later is not a valid input to setarch, nor will the kernel output
UTS_MACHINE as x86. The kernel sets utsname.machine to i[3456]86, which
all map to PER_LINUX32.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/confile.c

index 4e7dead7cfc44793a49d2a2e00bb99251d490bde..04bd03c712b9f8793cdd064c6e44b92003fb8610 100644 (file)
@@ -1807,7 +1807,7 @@ static int lxc_get_arch_entry(struct lxc_conf *c, char *retv, int inlen)
        int len = 0;
 
        switch(c->personality) {
-       case PER_LINUX32: strprint(retv, inlen, "x86"); break;
+       case PER_LINUX32: strprint(retv, inlen, "i686"); break;
        case PER_LINUX: strprint(retv, inlen, "x86_64"); break;
        default: break;
        }
@@ -2259,7 +2259,7 @@ void write_config(FILE *fout, struct lxc_conf *c)
                fprintf(fout, "lxc.stopsignal = SIG%s\n", sig_name(c->stopsignal));
        #if HAVE_SYS_PERSONALITY_H
        switch(c->personality) {
-       case PER_LINUX32: fprintf(fout, "lxc.arch = x86\n"); break;
+       case PER_LINUX32: fprintf(fout, "lxc.arch = i686\n"); break;
        case PER_LINUX: fprintf(fout, "lxc.arch = x86_64\n"); break;
        default: break;
        }