qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [Bug 1818483] Re: qemu user mode does not support binfmt_misc config with flags include "P"
Date: Thu, 07 Mar 2019 09:52:27 -0000	[thread overview]
Message-ID: <155195234774.17622.798344608284858374.malone@gac.canonical.com> (raw)
In-Reply-To: 155168800961.29550.2360664198558693792.malonedeb@chaenomeles.canonical.com

The question is: can we have one set of QEMU code that copes correctly
with both 'binfmt_misc with P flag' and 'binfmt_misc without P flag' ?

Your patch makes -P work but breaks some cases without it. That means
it's not backwards compatible with all the existing QEMU installations
and use cases in the world, which means it's awkward to move to. It
would be better if there were a mechanism which would allow us to make
them both work.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1818483

Title:
  qemu user mode does not support binfmt_misc config with flags include
  "P"

Status in QEMU:
  New

Bug description:
  Hi Sir:
  During our test in chroot environment with qemu-user-static, we got some test cases failed because of program output warning with unexpected full path name.
  For example in test module "Devscripts"
  the test item for broken tarball expected the warning info:
  <tar: This does not look like a tar archive
  tar: ******* >
  but the output was:
  </bin/tar: This does not look like a tar archive
  /bin/tar: ******>
  the cause is the config file of binfmt_misc was set not to send argv0, for example:
  type command "tar" after chroot:
  ==========================
  lpeng@lpeng-VirtualBox:~/projects_lpeng/qemu/mips_2/sid$ sudo chroot .
  [sudo] password for lpeng: 
  root@lpeng-VirtualBox:/# tar
  /bin/tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
  Try '/bin/tar --help' or '/bin/tar --usage' for more information.
  root@lpeng-VirtualBox:/# 
  ===========================

  by adding output log in main()@qemu/Linux-user/main.c
  we found the original input command was changed, and qemu do not know that, we got the input args:
  argv_0----/usr/bin/qemu-mips64el-static---
  argv_1----/bin/tar---
  argv_2----NULL---

  Next step we modified the flags=P in the corresponding config under folder /proc/sys/fs/binfmt_misc, then binfmt_misc sent argv[0] to qemu.
  But chroot could not start bash because in current qemu dose not consider about this unexpected one more"argv[0]"

  
  After modified qemu code temporary to handle the new argv list we got the input args, and from argv[2] is the original input command
  argv_0----/usr/bin/qemu-mips64el-static---
  argv_1----/bin/tar---
  argv_2----tar---

  We need the original input from command line, so is it possible that let binfmt_misc to pass one more additional args or env to qemu as a token of the binfmt_misc flag, then qemu can judge how to parse the input args by it?
  looking forward your suggestions.

  Thanks
  luyou

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1818483/+subscriptions

  parent reply	other threads:[~2019-03-07 10:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04  8:26 [Qemu-devel] [Bug 1818483] [NEW] qemu user mode does not support binfmt_misc config with flags=P Luyou Peng
2019-03-05 11:30 ` [Qemu-devel] [Bug 1818483] " Luyou Peng
2019-03-05 11:56 ` [Qemu-devel] [Bug 1818483] Re: qemu user mode does not support binfmt_misc config with flags include "P" Peter Maydell
2019-03-07  6:08 ` Luyou Peng
2019-03-07  9:52 ` Peter Maydell [this message]
2019-03-07 10:19 ` Luyou Peng
2019-03-10 13:50 ` YunQiang Su
2019-04-03 14:45 ` YunQiang Su
2019-04-04  0:47 ` YunQiang Su
2021-05-05 17:42 ` Thomas Huth
2021-07-05  4:17 ` Launchpad Bug Tracker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=155195234774.17622.798344608284858374.malone@gac.canonical.com \
    --to=peter.maydell@linaro.org \
    --cc=1818483@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).