qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: Add binfmt wrapper


From: Joakim Tjernlund
Subject: Re: [Qemu-devel] [PATCH] linux-user: Add binfmt wrapper
Date: Mon, 14 Jul 2014 19:01:11 +0200

Alexander Graf <address@hidden> wrote on 2014/07/14 18:54:27:
> 
> 
> On 14.07.14 18:51, Joakim Tjernlund wrote:
> > Alexander Graf <address@hidden> wrote on 2014/07/14 18:34:34:
> >>
> >> On 14.07.14 18:32, Joakim Tjernlund wrote:
> >>> Alexander Graf <address@hidden> wrote on 2014/07/14 18:00:35:
> >>> You think everyone feel OK with new defaults like OP ?
> >>>> Yes.
> >>> hmm, with current qemu it works to boot a LXC with just O flag.
> >>> Why would we then want to complicate things by adding OP which
> >>> then requires some version of my patch?
> >> How does current QEMU boot anything with the 0 flag? It doesn't know 
how
> >> to handle it and will misinterpret the argument, no?
> > Playing some, one could possibly do both:
> >
> > -    if (i > 0 && strcmp(binfmt, "-binfmt-wrapper") == 0) {
> > +    execfd = qemu_getauxval(AT_EXECFD);
> > +    if (execfd > 0 || i > 0 && strcmp(binfmt, "-binfmt-wrapper") == 
0) {
> 
> 0 is a valid fd :). And yes, this would work, but I don't see why we 

Not according to qemu:
    execfd = qemu_getauxval(AT_EXECFD);
    if (execfd == 0) {
        execfd = open(filename, O_RDONLY);
        if (execfd < 0) {
            printf("Error while loading %s: %s\n", filename, 
strerror(errno));
            _exit(1);
        }
    }

> should introduce the -binfmt-wrapper logic to upstream QEMU. It's never 
> been there. And the AT_EXECFD evaluation is a lot cleaner.

It is, it is just an option to those who want to use P only(for security 
reasons).
Then there is a built-in fallback which is much easier to use that the 
current external program.
I can do both, first the execfd and the other ontop, then you choose :)

> 
> While we're at it - should we also pass the C flag to binfmt_misc?

That should be a user/distribution choise, not sure what should be default 
in
QEMU.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]