提交 eae1c286 编写于 作者: G Gao feng 提交者: Eric Blake

LXC: remove unnecessary check on root filesystem

After commit c131525b
"Auto-add a root <filesystem> element to LXC containers on startup"
for libvirt lxc, root must be existent.
Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
上级 d8b31306
......@@ -1940,17 +1940,13 @@ static int lxcContainerChild(void *data)
root = virDomainGetRootFilesystem(vmDef);
if (argv->nttyPaths) {
if (root) {
const char *tty = argv->ttyPaths[0];
if (STRPREFIX(tty, "/dev/pts/"))
tty += strlen("/dev/pts/");
if (virAsprintf(&ttyPath, "%s/%s.devpts/%s",
LXC_STATE_DIR, vmDef->name, tty) < 0) {
virReportOOMError();
goto cleanup;
}
} else if (VIR_STRDUP(ttyPath, argv->ttyPaths[0]) < 0) {
goto cleanup;
const char *tty = argv->ttyPaths[0];
if (STRPREFIX(tty, "/dev/pts/"))
tty += strlen("/dev/pts/");
if (virAsprintf(&ttyPath, "%s/%s.devpts/%s",
LXC_STATE_DIR, vmDef->name, tty) < 0) {
virReportOOMError();
goto cleanup;
}
} else if (VIR_STRDUP(ttyPath, "/dev/null") < 0) {
goto cleanup;
......
......@@ -1280,22 +1280,11 @@ cleanup:
static int
virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
{
virDomainFSDefPtr root = virDomainGetRootFilesystem(ctrl->def);
char *mount_options = NULL;
char *opts = NULL;
char *devpts = NULL;
int ret = -1;
if (!root) {
if (ctrl->nconsoles != 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Expected exactly one console, but got %zu"),
ctrl->nconsoles);
return -1;
}
return 0;
}
VIR_DEBUG("Setting up private /dev/pts");
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册