binfmt_misc: add persistent opened binary handler for containers
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 18 Feb 2016 00:51:16 +0000 (16:51 -0800)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 30 Mar 2016 21:12:22 +0000 (14:12 -0700)
commit948b701a607f123df92ed29084413e5dd8cda2ed
treea8ec94afaa37da897e283923d20d3bde16897d97
parent9a08c352d05305ca7651540c3b107da1e4e1f40b
binfmt_misc: add persistent opened binary handler for containers

This patch adds a new flag 'F' to the binfmt handlers.  If you pass in
'F' the binary that runs the emulation will be opened immediately and
in future, will be cloned from the open file.

The net effect is that the handler survives both changeroots and mount
namespace changes, making it easy to work with foreign architecture
containers without contaminating the container image with the
emulator.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
fs/binfmt_misc.c