From: Cole Robinson Date: Thu, 2 Jun 2011 18:25:25 +0000 (-0400) Subject: lxc: Verify root fs exists before mounting X-Git-Tag: v0.9.3-rc1~220 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4fb706a5a7a8133e8bbddcfba57d7dcf373b7888;p=thirdparty%2Flibvirt.git lxc: Verify root fs exists before mounting Otherwise the following virFileMakePath will create the directory for us and fail further ahead, which probably isn't intended. --- diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index c94d0d08d9..7d60090ac8 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -664,6 +664,14 @@ lxcControllerRun(virDomainDefPtr def, */ if (root) { VIR_DEBUG("Setting up private /dev/pts"); + + if (!virFileExists(root->src)) { + virReportSystemError(errno, + _("root source %s does not exist"), + root->src); + goto cleanup; + } + if (unshare(CLONE_NEWNS) < 0) { virReportSystemError(errno, "%s", _("Cannot unshare mount namespace"));