[libvirt] [PATCH] Allow 32-on-64 execution for LXC guests

Eric Blake eblake at redhat.com
Wed Feb 23 21:08:49 UTC 2011


On 02/23/2011 10:20 AM, Daniel P. Berrange wrote:
> Using the 'personality(2)' system call, we can make a container
> on an x86_64 host appear to be i686. Likewise for most other
> Linux 64bit arches.
> 
> * src/lxc/lxc_conf.c: Fill in 32bit capabilities for x86_64 hosts
> * src/lxc/lxc_container.h, src/lxc/lxc_container.c: Add API to
>   check if an arch has a 32bit alternative
> * src/lxc/lxc_controller.c: Set the process personality when
>   starting guest

> @@ -73,7 +75,7 @@ virCapsPtr lxcCapsInit(void)
>      if ((guest = virCapabilitiesAddGuest(caps,
>                                           "exe",
>                                           utsname.machine,
> -                                         sizeof(int) == 4 ? 32 : 8,
> +                                         sizeof(void*) == 4 ? 32 : 64,

How long have we had that bug?  Thankfully, sizeof(int) is 4 on both
32-bit and 64-bit Linux, so we were never setting 8 as the number of
bits per CPU word.  This fix alone is worth the patch.

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110223/647d1787/attachment-0001.sig>


More information about the libvir-list mailing list