From: Laszlo Ersek <lersek@redhat.com>
To: "Gabriel L. Somlo" <gsomlo@gmail.com>,
Matt Fleming <matt.fleming@intel.com>
Cc: gleb@cloudius-systems.com, rjones@redhat.com,
jordan.l.justen@intel.com, mdroth@linux.vnet.ibm.com,
qemu-devel@nongnu.org, kraxel@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] RFC: guest-side retrieval of fw_cfg file
Date: Tue, 21 Jul 2015 00:07:08 +0200 [thread overview]
Message-ID: <55AD710C.9040203@redhat.com> (raw)
In-Reply-To: <20150720211935.GC1606@HEDWIG.INI.CMU.EDU>
On 07/20/15 23:19, Gabriel L. Somlo wrote:
> The code to build nested ksets (represending sub-sub-directories of
> /sys/firmware/fw_cfg/...) and cleaning them up on exit doesn't promise
> to be *too* horrible or bulky, but as I was getting ready to start
> writing it, I realized that, in theory, nothing is to stop the fw_cfg
> device from having files named e.g.
>
> "etc/foo"
>
> and
>
> "etc/foo/bar"
>
> That doesn't happen right now on the qemu side, but it could in
> theory, and I have no idea how I'd deal with the file/directory
> duality of "foo" in this situation, short of refusing to load the
> module, or leaving out one fw_cfg file or the other. Unless there's
> a way around this, I think it's safer to either stick with the default
> 's/\//!/g' scheme of the kobject library, or implement something like
> systemd's string escaping scheme that's been suggested earlier in this
> thread...
>
> Or maybe leaving out the occasional poorly-named file is still better
> than giving up the ability to run find on the fw_cfg sysfs folder ?
I assume once you have "etc/foo" in place (ie. as part of the
filesystem), where "foo" is not a directory, then the attempt to create
"etc/foo/bar" will cause whatever kernel API is in use to return ENOTDIR.
Since you are checking return values anyway :), just barf a warning into
syslog, and either skip the fw_cfg file, or abort module loading
completely, as you see fit. This is a user error -- you should punish
the user for it, not yourself. :)
... I just love "find", sorry. :) Anyway, I don't envision myself as a
user of this feature any time soon, so please feel free to ignore me.
Thanks
Laszlo
next prev parent reply other threads:[~2015-07-20 22:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 20:09 [Qemu-devel] RFC: guest-side retrieval of fw_cfg file Gabriel L. Somlo
2015-07-13 23:03 ` Eric Blake
2015-07-14 17:00 ` Gabriel L. Somlo
2015-07-15 11:06 ` Matt Fleming
2015-07-15 11:15 ` Laszlo Ersek
2015-07-14 9:43 ` Richard W.M. Jones
2015-07-14 18:23 ` Gabriel L. Somlo
2015-07-14 18:31 ` Gabriel L. Somlo
2015-07-14 18:48 ` Richard W.M. Jones
2015-07-14 18:51 ` Richard W.M. Jones
2015-07-14 19:16 ` Peter Maydell
2015-07-14 19:24 ` Gabriel L. Somlo
2015-07-14 19:24 ` Gerd Hoffmann
2015-07-16 0:43 ` Gabriel L. Somlo
2015-07-16 19:27 ` Eric Blake
2015-07-16 20:42 ` Gabriel L. Somlo
2015-07-14 11:38 ` Laszlo Ersek
2015-07-15 12:00 ` Matt Fleming
2015-07-20 21:19 ` Gabriel L. Somlo
2015-07-20 22:07 ` Laszlo Ersek [this message]
2015-07-25 23:21 ` Gabriel L. Somlo
2015-07-26 9:37 ` Laszlo Ersek
2015-07-15 14:08 ` Michael S. Tsirkin
2015-07-15 16:01 ` Igor Mammedov
2015-07-15 16:24 ` Michael S. Tsirkin
2015-07-16 1:21 ` Gabriel L. Somlo
2015-07-16 6:57 ` Igor Mammedov
2015-07-16 7:30 ` Michael S. Tsirkin
2015-07-16 9:50 ` Igor Mammedov
2015-07-16 10:25 ` Michael S. Tsirkin
2015-07-16 11:15 ` Igor Mammedov
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=55AD710C.9040203@redhat.com \
--to=lersek@redhat.com \
--cc=gleb@cloudius-systems.com \
--cc=gsomlo@gmail.com \
--cc=jordan.l.justen@intel.com \
--cc=kraxel@redhat.com \
--cc=matt.fleming@intel.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
/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).