From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzWQJ-0004GP-R4 for qemu-devel@nongnu.org; Mon, 10 Nov 2008 08:03:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzWQJ-0004GC-0h for qemu-devel@nongnu.org; Mon, 10 Nov 2008 08:03:19 -0500 Received: from [199.232.76.173] (port=59752 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzWQI-0004G9-TO for qemu-devel@nongnu.org; Mon, 10 Nov 2008 08:03:18 -0500 Received: from rv-out-0708.google.com ([209.85.198.240]:27260) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KzWQI-0004Mn-EU for qemu-devel@nongnu.org; Mon, 10 Nov 2008 08:03:18 -0500 Received: by rv-out-0708.google.com with SMTP id f25so2368980rvb.22 for ; Mon, 10 Nov 2008 05:03:17 -0800 (PST) Message-ID: Date: Mon, 10 Nov 2008 14:03:16 +0100 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [PATCH, v2] Introduce --enable-binfmt-misc configure option In-Reply-To: <1225534248-3248-1-git-send-email-kirill@shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1223892640-15545-10-git-send-email-kirill@shutemov.name> <1225534248-3248-1-git-send-email-kirill@shutemov.name> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Kirill A. Shutemov" 2008/11/1 Kirill A. Shutemov : > It makes qemu compatible with binfmt_misc's flags 'P' and 'O'. > > 'P' - preserve-argv[0]. Legacy behavior of binfmt_misc is to overwrite the > original argv[0] with the full path to the binary. When this flag is > included, binfmt_misc will add an argument to the argument vector for > this purpose, thus preserving the original argv[0]. > > 'O' - open-binary. Legacy behavior of binfmt_misc is to pass the full path > of the binary to the interpreter as an argument. When this flag is > included, binfmt_misc will open the file for reading and pass its > descriptor as an argument, instead of the full path, thus allowing > the interpreter to execute non-readable binaries. > > Signed-off-by: Kirill A. Shutemov > --- > configure | 86 ++++++++++++++++++++++++++---------------------- > linux-user/linuxload.c | 7 +--- > linux-user/main.c | 39 ++++++++++++++++++++- > linux-user/qemu.h | 2 +- > 4 files changed, 87 insertions(+), 47 deletions(-) > > diff --git a/configure b/configure > index ccc4ae0..c7e2732 100755 > --- a/configure > +++ b/configure > @@ -114,6 +114,7 @@ aio="yes" > nptl="yes" > mixemu="no" > bluez="yes" > +binfmt_misc="no" > > # OS specific > targetos=`uname -s` > @@ -355,6 +356,8 @@ for opt do > ;; > --disable-aio) aio="no" > ;; > + --enable-binfmt-misc) binfmt_misc="yes" > + ;; I don't know what binfmt-misc is good for, but there's nothing in the new code that must be done in compile time, I think the #ifdef could just be an if ().