[Devel] [RFC rh7 v2] ve/tty: vt -- Implement per VE support for virtual consoles

Vladimir Davydov vdavydov at parallels.com
Thu Jul 30 07:28:48 PDT 2015


On Thu, Jul 30, 2015 at 03:51:55PM +0300, Cyrill Gorcunov wrote:

> Now we support up to MAX_NR_VE_CONSOLES virtual consoles inside container.
> For /dev/console we reserve first virtual terminal. Terminals represent
> the following mapping
> 
> 	 | master					slave
> 	 | /dev/cosole|/dev/tty0|/dev/vztm0		/dev/vzts0
> 	 | ...
> 	 | /dev/tty11|/dev/vztm11			/dev/vzts11
> 
> major:minor numbers for peers are allocated dynamically by the kenel,
> thus if we need to connect to container's slave peer from the node
> we have to
> 
>  - scan node's /proc/tty/drivers and find the numbers for
>    "vzt_slave" driver, for example
> 
> 	 | [root at pcs7 ~]# cat /proc/tty/drivers 
> 	 | ...
> 	 | vzt_slave            /dev/vzts     252 0-11 console
> 	 | vzt_master           /dev/vztm     253 0-11 console
> 	 | ...

How is vzctl supposed to find which vztm corresponds to which VE?

> 
>  - add major:minor pairs into allowed devices, for example
> 
> 	 | echo 'c 253:* rwm' > /sys/fs/cgroup/devices/$ctid/devices.allow
> 
> Once the bullets above is done the userspace utility may
> open up slave peer and read/write data to/from. Note the
> slave may be opened if only if a master peer been previously
> opened.

I.e. our VNC viewer (or whatever it is using /dev/console), needs to
mknod somewhere c 252 0 and then read/write it?



More information about the Devel mailing list