All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: LXC development mailing-list <lxc-devel@lists.linuxcontainers.org>
Cc: linux-kernel@vger.kernel.org, Miklos Szeredi <miklos@szeredi.hu>,
	fuse-devel <fuse-devel@lists.sourceforge.net>,
	Tejun Heo <tj@kernel.org>,
	Seth Forshee <seth.forshee@canonical.com>,
	serge.hallyn@ubuntu.com
Subject: Re: [lxc-devel] device namespaces
Date: Tue, 23 Sep 2014 22:04:30 -0700	[thread overview]
Message-ID: <87bnq5vcbl.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <CALRD3qKmpzJCRszkG_S9Z3XgoTGWVMFd7FqeJh+W-9pZqPVhCg@mail.gmail.com> (riya khanna's message of "Tue, 23 Sep 2014 23:34:46 -0500")

riya khanna <riyakhanna1983@gmail.com> writes:

> (Please pardon multiple emails, artifact of merging all separate conversations)
>
> Thanks for your feedback! 
>
> Letting the kernel know about what devices a container could access (based on
> device cgroups) and having devtmpfs in the kernel create device nodes for a
> container that map to corresponding CUSE nodes is what I thought of. For
> example, "echo 29:0 > /proc/<pid>/devices" would prepare a virtual framebuffer
> (based on real fb0 SCREENINFO properties) for this process provided permissions
> allow this operation. To view the framebuffer, the CUSE based virtual device
> would talk to the actual hardware. Since namespaces would have different view of
> the underlying devices, "sysfs" has to made aware of this as well. 
>
> Please let me know your inputs. Thanks again!

The solution hugely depends on what you are trying to do with it.

The situation today is that device nodes are slowly fading out.  In
another 20 years linux may not have any device nodes at all.

Therefore the question becomes what are you trying to support.

If it is just filtering of existing device nodes.  We can do a pretty
good approximation with bind mounts.

If you want to emulate a device you can use normal fuse (not cuse).
As normal fuse file will support arbitrary ioctls.

There are a few cases where it is desirable to emulate what devpts
does for allowing arbitrary users to creating virtual devices in the
kernel.  Loop devices in particular.

Ultimately given the existence of device hotplug I don't see any call
for being able to create device nodes with well known device numbers
(fundamentally what a device namespace would be about).

The conversation last year was about people wanting to multiplex devices
that don't have multiplexer support in the kernel.  If that is your
desire I think it is entirely reasonable to device type by device type
add support for multiplexing that device type to the kernel, or
potentially just use fuse or cuse to implement your multiplexer in
userspace but that has the potential to be unusably slow.

Eric

       reply	other threads:[~2014-09-24  5:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CALRD3qKmpzJCRszkG_S9Z3XgoTGWVMFd7FqeJh+W-9pZqPVhCg@mail.gmail.com>
2014-09-24  5:04 ` Eric W. Biederman [this message]
     [not found]   ` <CALRD3qKPJHmmY2DSNNfNKzmLihDLm9fgBQprCXNMHVOArV4iuw@mail.gmail.com>
2014-09-24 16:37     ` [lxc-devel] device namespaces Serge Hallyn
2014-09-24 17:43       ` Using devices in Containers (was: [lxc-devel] device namespaces) Eric W. Biederman
2014-09-24 19:30         ` Riya Khanna
2014-09-24 22:38           ` Using devices in Containers Eric W. Biederman
     [not found]             ` <CALRD3qLYAc+K8e1xYb27ipi4KyGRmTxokPCHN0L_zta=Cy9sCQ@mail.gmail.com>
2014-09-25 15:40               ` riya khanna
2014-09-25 18:09                 ` Eric W. Biederman
2014-09-25 18:21               ` Eric W. Biederman
2014-09-24 19:07       ` [lxc-devel] device namespaces Riya Khanna
2014-09-24 16:38   ` Serge Hallyn
2013-09-08 12:28 RFC: Device Namespaces Amir Goldstein
2013-09-09  0:51 ` Eric W. Biederman
2013-09-10  7:09   ` Amir Goldstein
2013-09-25 11:05     ` Janne Karhunen
2013-09-25 21:34       ` Eric W. Biederman
2013-09-26  5:33         ` Greg Kroah-Hartman
2013-10-01  6:19           ` Janne Karhunen
2013-10-01 17:27             ` Andy Lutomirski
2013-10-01 17:53               ` Serge E. Hallyn
2013-10-01 19:51                 ` Eric W. Biederman
2013-10-01 20:46                   ` Serge Hallyn
2013-10-01 22:59                     ` [lxc-devel] " Michael H. Warfield

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=87bnq5vcbl.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lxc-devel@lists.linuxcontainers.org \
    --cc=miklos@szeredi.hu \
    --cc=serge.hallyn@ubuntu.com \
    --cc=seth.forshee@canonical.com \
    --cc=tj@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.