[libvirt] [PATCH] lxc: new tty for container

The lxc driver xml parser treats the console element as input when it should be output only. This obviously causes problems when anything other than /dev/ptmx is specified or when a container is shutdown and then restarted without redefining it (so that the console field is reset). This patch treats the console element as output only and always creates a new device when starting a container. Also fixed up a string overflow when storing the device name. Thanks! -- Best Regards, Dave Leskovec IBM Linux Technology Center Open Virtualization

On Thu, Jun 05, 2008 at 11:59:34PM -0700, Dave Leskovec wrote:
The lxc driver xml parser treats the console element as input when it should be output only. This obviously causes problems when anything other than /dev/ptmx is specified or when a container is shutdown and then restarted without redefining it (so that the console field is reset). This patch treats the console element as output only and always creates a new device when starting a container. Also fixed up a string overflow when storing the device name.
Yes, this is good. When using PTY's this is definitely output-only. No one should be using the ancient manually allocated pre-Unix98 TTYs. I'd not come across posix_openpt() before though - I'm used to openpty(). Since this is a Linux specific driver though, there's no portability issues to worry about so I'm happy with either. Regards, Daniel. -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, Jun 06, 2008 at 10:29:04AM +0100, Daniel P. Berrange wrote:
On Thu, Jun 05, 2008 at 11:59:34PM -0700, Dave Leskovec wrote:
The lxc driver xml parser treats the console element as input when it should be output only. This obviously causes problems when anything other than /dev/ptmx is specified or when a container is shutdown and then restarted without redefining it (so that the console field is reset). This patch treats the console element as output only and always creates a new device when starting a container. Also fixed up a string overflow when storing the device name.
Yes, this is good. When using PTY's this is definitely output-only. No one should be using the ancient manually allocated pre-Unix98 TTYs. I'd not come across posix_openpt() before though - I'm used to openpty(). Since this is a Linux specific driver though, there's no portability issues to worry about so I'm happy with either.
Fine by me too, +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel Veillard wrote:
On Fri, Jun 06, 2008 at 10:29:04AM +0100, Daniel P. Berrange wrote:
On Thu, Jun 05, 2008 at 11:59:34PM -0700, Dave Leskovec wrote:
The lxc driver xml parser treats the console element as input when it should be output only. This obviously causes problems when anything other than /dev/ptmx is specified or when a container is shutdown and then restarted without redefining it (so that the console field is reset). This patch treats the console element as output only and always creates a new device when starting a container. Also fixed up a string overflow when storing the device name. Yes, this is good. When using PTY's this is definitely output-only. No one should be using the ancient manually allocated pre-Unix98 TTYs. I'd not come across posix_openpt() before though - I'm used to openpty(). Since this is a Linux specific driver though, there's no portability issues to worry about so I'm happy with either.
Fine by me too, +1
Daniel
Thanks Daniel and Daniel. I've committed this. -- Best Regards, Dave Leskovec IBM Linux Technology Center Open Virtualization
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Dave Leskovec