Mon Jun 9 15:42:34 PST 2008 David L. Leskovec <dlesko@linux.vnet.ibm.com>

* src/lxc_driver.c: Make console element is output only.  Always open new
	PTY when starting a container.
	Fix string overrun when storing console name in VM def struct
This commit is contained in:
David L. Leskovec 2008-06-09 22:51:32 +00:00
parent 787e44a1d0
commit 0d0c96722c
2 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,9 @@
Mon Jun 9 15:42:34 PST 2008 David L. Leskovec <dlesko@linux.vnet.ibm.com>
* src/lxc_driver.c: Console element is output only. Always open new
PTY when starting a container.
Fix string overrun when storing console name in VM def struct
Mon Jun 9 13:14:00 BST 2008 Richard W.M. Jones <rjones@redhat.com> Mon Jun 9 13:14:00 BST 2008 Richard W.M. Jones <rjones@redhat.com>
Better error messages in xend driver. Better error messages in xend driver.
@ -56,7 +62,7 @@ Thu Jun 5 14:10:00 BST 2008 Richard W.M. Jones <rjones@redhat.com>
Wed Jun 4 23:02:21 PST 2008 David L. Leskovec <dlesko@linux.vnet.ibm.com> Wed Jun 4 23:02:21 PST 2008 David L. Leskovec <dlesko@linux.vnet.ibm.com>
* src/lxc_driver.c: Add sanity of tty pid before kill() * src/lxc_driver.c: Add sanity check of tty pid before kill()
Ignore ECHILD errors during VM cleanup Ignore ECHILD errors during VM cleanup
Call functions to store tty pid and cleanup tty pid file Call functions to store tty pid and cleanup tty pid file
* src/lxc_conf.h: Add function to verify container process exists * src/lxc_conf.h: Add function to verify container process exists

View File

@ -41,6 +41,7 @@
#include "lxc_driver.h" #include "lxc_driver.h"
#include "driver.h" #include "driver.h"
#include "internal.h" #include "internal.h"
#include "memory.h"
#include "util.h" #include "util.h"
#include "memory.h" #include "memory.h"
@ -484,7 +485,7 @@ static int lxcSetupTtyTunnel(virConnectPtr conn,
char *ptsStr; char *ptsStr;
if (0 < strlen(vmDef->tty)) { if (0 < strlen(vmDef->tty)) {
*ttyDev = open(vmDef->tty, O_RDWR|O_NOCTTY|O_NONBLOCK); *ttyDev = posix_openpt(O_RDWR|O_NOCTTY|O_NONBLOCK);
if (*ttyDev < 0) { if (*ttyDev < 0) {
lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR, lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR,
"open() tty failed: %s", strerror(errno)); "open() tty failed: %s", strerror(errno));
@ -513,8 +514,11 @@ static int lxcSetupTtyTunnel(virConnectPtr conn,
goto setup_complete; goto setup_complete;
} }
/* This value needs to be stored in the container configuration file */ /* This value needs to be stored in the container configuration file */
if (STRNEQ(ptsStr, vmDef->tty)) { VIR_FREE(vmDef->tty);
strcpy(vmDef->tty, ptsStr); if (!(vmDef->tty = strdup(ptsStr))) {
lxcError(conn, NULL, VIR_ERR_NO_MEMORY,
_("unable to get storage for vm tty name"));
goto setup_complete;
} }
/* Enter raw mode, so all characters are passed directly to child */ /* Enter raw mode, so all characters are passed directly to child */