mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
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:
parent
787e44a1d0
commit
0d0c96722c
@ -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>
|
||||
|
||||
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>
|
||||
|
||||
* 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
|
||||
Call functions to store tty pid and cleanup tty pid file
|
||||
* src/lxc_conf.h: Add function to verify container process exists
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "lxc_driver.h"
|
||||
#include "driver.h"
|
||||
#include "internal.h"
|
||||
#include "memory.h"
|
||||
#include "util.h"
|
||||
#include "memory.h"
|
||||
|
||||
@ -484,7 +485,7 @@ static int lxcSetupTtyTunnel(virConnectPtr conn,
|
||||
char *ptsStr;
|
||||
|
||||
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) {
|
||||
lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||
"open() tty failed: %s", strerror(errno));
|
||||
@ -513,8 +514,11 @@ static int lxcSetupTtyTunnel(virConnectPtr conn,
|
||||
goto setup_complete;
|
||||
}
|
||||
/* This value needs to be stored in the container configuration file */
|
||||
if (STRNEQ(ptsStr, vmDef->tty)) {
|
||||
strcpy(vmDef->tty, ptsStr);
|
||||
VIR_FREE(vmDef->tty);
|
||||
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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user