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.
This commit is contained in:
Cole Robinson 2011-06-02 14:25:25 -04:00
parent a7e2dd1c32
commit 4fb706a5a7

View File

@ -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"));