qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: pbonzini@redhat.com, "Gabriel L. Somlo" <somlo@cmu.edu>,
	qemu-devel@nongnu.org, armbru@redhat.com, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/
Date: Thu, 17 Mar 2016 09:49:00 +0100	[thread overview]
Message-ID: <56EA6F7C.6090700@redhat.com> (raw)
In-Reply-To: <20160316222436-mutt-send-email-mst@redhat.com>

On 03/16/16 21:31, Michael S. Tsirkin wrote:
> On Wed, Mar 16, 2016 at 07:35:09PM +0100, Laszlo Ersek wrote:
>> OVMF uses this feature for a few flags. They are all called
>> "opt/ovmf/...". I followed the advice in "docs/specs/fw_cfg.txt" (which
>> shouldn't be surprising since I seem to have reviewed every patch for
>> that file):
> 
> Wait a second.  You are saying upsteam OVMF puts files there.

Sorry, I wasn't clear enough. OVMF consumes files that are put there by
the user.

> If users add their own flags that happen to be in opt/ovmf/ then
> what happens? And how do they *know* they should avoid that?
> There's no warning, guest just breaks in various ways.
> 
> This is exactly the kind of mess I was worried about. We have a global
> namespace with no way to control what goes where.
> 
> opt/ was for end users not firmware.
> 
> The right thing to do would be for ovmf to reserve itself
> a directory under root.
> 
> This really needs more thought.  For now I'd suggest we drop the whole
> interface from 2.6 and come back to it after 2.6.

I very strongly disagree. -fw_cfg was invented exactly for the purpose
that guest code (mostly, but not exclusively, guest firmware code) can
take settings from the user without QEMU's knowledge. We were conscious
of the namespace question, which is why the opt/ prefix was strongly
recommended for such knobs. Trying to control it all from QEMU (beyond
setting aside the opt/ subdirectory, regardless if it's worded "should"
or "must"), introducing a central registry for prefixes, would defeat
the entire purpose.

Subdividing the namespace under opt/ was purposely left open. Then I
went with opt/ovmf/ for files that OVMF should take from users because
that's the obvious choice.

If we want to be extremely paranoid about the namespace, we can modify
the recommendation to say "use opt/UUID/...", where UUID is generated
with "uuidgen". That's just an example I know from UEFI; it is how the
entire namespace question is side-stepped without a central registry.
Nonetheless, OVMF is the second of two guest firmwares in total, so
"opt/ovmf/" is the obvious choice.

Removing the interface would break existing code in OVMF that (a)
consumes opt/ovmf/... files and (b) doesn't disturb anything at all
otherwise.

Plus, the -fw_cfg option was released in 2.4 (added around commit
81b2b81062).

Laszlo

  reply	other threads:[~2016-03-17  8:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 14:47 [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/ Michael S. Tsirkin
2016-03-16 16:29 ` Markus Armbruster
2016-03-16 16:50   ` Michael S. Tsirkin
2016-03-16 18:15     ` Gabriel L. Somlo
2016-03-16 18:35       ` Laszlo Ersek
2016-03-16 18:43         ` Michael S. Tsirkin
2016-03-16 19:15           ` Laszlo Ersek
2016-03-16 20:22             ` Michael S. Tsirkin
2016-03-16 20:24             ` Michael S. Tsirkin
2016-03-16 20:31         ` Michael S. Tsirkin
2016-03-17  8:49           ` Laszlo Ersek [this message]
2016-03-17  9:40             ` Paolo Bonzini
2016-03-17 11:32               ` Michael S. Tsirkin
2016-03-17 13:12                 ` Paolo Bonzini
2016-03-17 13:15                   ` Michael S. Tsirkin
2016-03-17  8:42         ` Gerd Hoffmann
2016-03-17  9:43           ` Laszlo Ersek
2016-03-17 10:22             ` Gerd Hoffmann
2016-03-17 13:28               ` Laszlo Ersek
2016-03-17 13:35                 ` Michael S. Tsirkin
2016-03-17 13:37                   ` Paolo Bonzini
2016-03-17 16:59                 ` Gerd Hoffmann
2016-03-17 13:23             ` Michael S. Tsirkin
2016-03-17  9:49           ` Laszlo Ersek
2016-03-17 10:09 ` Markus Armbruster
2016-03-17 13:13   ` Michael S. Tsirkin
2016-03-17 13:30     ` Paolo Bonzini
2016-03-17 13:49       ` Laszlo Ersek
2016-03-17 13:49       ` Michael S. Tsirkin
2016-03-17 13:55         ` Paolo Bonzini
2016-03-17 14:17           ` Michael S. Tsirkin
2016-03-17 14:50             ` Paolo Bonzini
2016-03-17 15:40               ` Michael S. Tsirkin
2016-03-17 17:17       ` Gerd Hoffmann
2016-03-17 19:35         ` Paolo Bonzini
2016-03-17 19:55           ` Michael S. Tsirkin

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=56EA6F7C.6090700@redhat.com \
    --to=lersek@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=somlo@cmu.edu \
    /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).