From: Cole Robinson Date: Thu, 2 Jun 2011 19:25:21 +0000 (-0400) Subject: lxc: Ensure container actually exists X-Git-Tag: v0.9.3-rc1~219 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9e8d6a065129f9b33b721712ddfdef36eb80be2;p=thirdparty%2Flibvirt.git lxc: Ensure container actually exists Since we can't really get useful error reporting from virCommandExec since it needs to be the last thing we do. --- diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 26b493ec81..7924858879 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -785,6 +785,13 @@ static int lxcContainerChild( void *data ) if (lxcContainerSetupMounts(vmDef, root) < 0) goto cleanup; + if (!virFileExists(vmDef->os.init)) { + virReportSystemError(errno, + _("cannot find init path '%s' relative to container root"), + vmDef->os.init); + goto cleanup; + } + /* Wait for interface devices to show up */ if (lxcContainerWaitForContinue(argv->monitor) < 0) { virReportSystemError(errno, "%s",