mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
LXC: remove unnecessary check on root filesystem
After commit c131525bec
"Auto-add a root <filesystem> element to LXC containers on startup"
for libvirt lxc, root must be existent.
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
This commit is contained in:
parent
d8b3130664
commit
eae1c286a1
@ -1940,17 +1940,13 @@ static int lxcContainerChild(void *data)
|
|||||||
root = virDomainGetRootFilesystem(vmDef);
|
root = virDomainGetRootFilesystem(vmDef);
|
||||||
|
|
||||||
if (argv->nttyPaths) {
|
if (argv->nttyPaths) {
|
||||||
if (root) {
|
const char *tty = argv->ttyPaths[0];
|
||||||
const char *tty = argv->ttyPaths[0];
|
if (STRPREFIX(tty, "/dev/pts/"))
|
||||||
if (STRPREFIX(tty, "/dev/pts/"))
|
tty += strlen("/dev/pts/");
|
||||||
tty += strlen("/dev/pts/");
|
if (virAsprintf(&ttyPath, "%s/%s.devpts/%s",
|
||||||
if (virAsprintf(&ttyPath, "%s/%s.devpts/%s",
|
LXC_STATE_DIR, vmDef->name, tty) < 0) {
|
||||||
LXC_STATE_DIR, vmDef->name, tty) < 0) {
|
virReportOOMError();
|
||||||
virReportOOMError();
|
goto cleanup;
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
} else if (VIR_STRDUP(ttyPath, argv->ttyPaths[0]) < 0) {
|
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
} else if (VIR_STRDUP(ttyPath, "/dev/null") < 0) {
|
} else if (VIR_STRDUP(ttyPath, "/dev/null") < 0) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -1280,22 +1280,11 @@ cleanup:
|
|||||||
static int
|
static int
|
||||||
virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
|
virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
|
||||||
{
|
{
|
||||||
virDomainFSDefPtr root = virDomainGetRootFilesystem(ctrl->def);
|
|
||||||
char *mount_options = NULL;
|
char *mount_options = NULL;
|
||||||
char *opts = NULL;
|
char *opts = NULL;
|
||||||
char *devpts = NULL;
|
char *devpts = NULL;
|
||||||
int ret = -1;
|
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");
|
VIR_DEBUG("Setting up private /dev/pts");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user