diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index f02b959eeb..8aba3baf1a 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -2093,8 +2093,10 @@ static int lxcContainerChild(void *data) if (virAsprintf(&ttyPath, "%s/%s.devpts/%s", LXC_STATE_DIR, vmDef->name, tty) < 0) goto cleanup; - } else if (VIR_STRDUP(ttyPath, "/dev/null") < 0) { - goto cleanup; + } else { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("At least one tty is required")); + goto cleanup; } VIR_DEBUG("Container TTY path: %s", ttyPath); diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index ed30c37fd1..6c83fdb217 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -1144,6 +1144,12 @@ int virLXCProcessStart(virConnectPtr conn, vm->def, NULL) < 0) goto cleanup; + if (vm->def->nconsoles == 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("At least one PTY console is required")); + goto cleanup; + } + for (i = 0; i < vm->def->nconsoles; i++) { char *ttyPath; if (vm->def->consoles[i]->source.type != VIR_DOMAIN_CHR_TYPE_PTY) {