From: Warner Losh <imp@bsdimp.com>
To: Christian Schoenebeck <qemu_oss@crudebyte.com>
Cc: Andrey Erokhin <language.lawyer@gmail.com>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [RFC PATCH] virtfs: 9p: local: add default uid and gid options
Date: Tue, 9 Dec 2025 03:38:34 -0700 [thread overview]
Message-ID: <CANCZdfpgLPyzJtz3RZQssAkWahmvpeAA-tKp7t_7BBdPMshajg@mail.gmail.com> (raw)
In-Reply-To: <2022919.PYKUYFuaPT@weasel>
[-- Attachment #1: Type: text/plain, Size: 2777 bytes --]
On Tue, Dec 9, 2025 at 3:21 AM Christian Schoenebeck <qemu_oss@crudebyte.com>
wrote:
> On Sunday, 7 December 2025 12:34:24 CET Warner Losh wrote:
> > On Sat, Dec 6, 2025, 10:12 AM Andrey Erokhin <language.lawyer@gmail.com>
>
> > wrote:
> > > On 03/12/2025 15:33, Christian Schoenebeck wrote:
> > > > On Monday, 1 December 2025 19:00:53 CET Andrey Erokhin wrote:
> [...]
> > > > But for passthrough it is not of any use, is it?
> > >
> > > Prolly none, just a side effect of how it's implemented.
> > > Can either make it an error when used with passthrough, or ignore them
> > > (use default -1 value) when copying options to 9p fs context (with or
> > > without a warning)
> > >
> > > > Also while it is very handy to have a short option name like "uid"
> and
> > >
> > > "gid", for the sake of long term progression and clarity an option name
> > > like "default-uid" would be more appropriate.
> > >
> > > Or rather default_uid, to match other options style? But uid/gid also
> > > kinda match fmode/dmode :\
>
> Right, that would render it strange having default_uid/default_gid vs.
> fmod/
> gmode when all of them actually mean default values.
>
> OK, as fmode/dmode are already there, then let's stick to your initial
> suggestion of just using uid/gid.
>
> But similar to fmode/dmode it should be made clear on documentation level
> that
> uid/gid are only useful for mapped security models.
>
> > FreeBSD has a mode where you can build the image where the files in the
> > filesystem are owned by the user with random permission bits, but the
> > actual owners / modes are in an mtree formatted file. The nopriv imagers
> > combine the two when making images. It would be nice to have p9 do a
> > simular mapping for the guest so I can boot test these images more
> directly
> > w/o the copyout to the "bootable image". The set the uid feature would
> > help, true, but leaves me wanting more.
>
> And a host level (not yet existing) tool like qemu-9p-chown, qemu-9p-chmod
> would be less appropriate for your use case?
>
I can't answer directly, since I can't look them up :)
But... I want to own all the files on the host, but I want them to conform
to a spec on
view p9 gives to the guest:
/etc/rc.d type=dir uname=root gname=wheel mode=755
./etc/rc.d/accounting type=file uname=root gname=wheel mode=555
./usr/bin type=dir uname=root gname=wheel mode=755
./usr type=dir uname=root gname=wheel mode=755
./usr/bin/last type=file uname=root gname=wheel mode=555
is a small excerpt of the file we happen to use (though I'm agnostic as to
the actual
format). But these files are long:
wc _.armv7.14.3.metalog
5316 26759 399552 _.armv7.14.3.metalog
which might pose problems...
Warner
[-- Attachment #2: Type: text/html, Size: 3595 bytes --]
prev parent reply other threads:[~2025-12-09 10:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 18:00 [RFC PATCH] virtfs: 9p: local: add default uid and gid options Andrey Erokhin
2025-12-03 10:33 ` Christian Schoenebeck
2025-12-06 17:10 ` Andrey Erokhin
2025-12-07 11:34 ` Warner Losh
2025-12-09 10:21 ` Christian Schoenebeck
2025-12-09 10:38 ` Warner Losh [this message]
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=CANCZdfpgLPyzJtz3RZQssAkWahmvpeAA-tKp7t_7BBdPMshajg@mail.gmail.com \
--to=imp@bsdimp.com \
--cc=language.lawyer@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu_oss@crudebyte.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).