output lxc.arch as i686 for PER_LINUX32

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>
This commit is contained in:
Dwight Engen 2014-04-28 16:51:06 -04:00 committed by Serge Hallyn
parent bb8d8207c3
commit 1462279962

View 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;
}