return 1;
}
-int lxc_create_console(struct lxc_console *console)
+int lxc_create_console(struct lxc_conf *conf)
{
struct termios tios;
+ struct lxc_console *console = &conf->console;
+
+ if (!conf->rootfs)
+ return 0;
if (openpty(&console->master, &console->slave,
console->name, NULL, NULL)) {
struct lxc_conf *conf = handler->conf;
struct lxc_console *console = &conf->console;
+ if (!conf->rootfs) {
+ INFO("no rootfs, no console.");
+ return 0;
+ }
+
if (lxc_mainloop_add_handler(descr, console->master,
console_handler, console)) {
ERROR("failed to add to mainloop console handler for '%d'",
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-extern int lxc_create_console(struct lxc_console *);
+extern int lxc_create_console(struct lxc_conf *);
extern void lxc_delete_console(struct lxc_console *);
extern int lxc_console_mainloop_add(struct lxc_epoll_descr *, struct lxc_handler *);
goto out_aborting;
}
- if (lxc_create_console(&conf->console)) {
+ if (lxc_create_console(conf)) {
ERROR("failed to create console");
goto out_delete_tty;
}