size_t nloopDevs;
int *loopDevFds;
+
+ virSecurityManagerPtr securityManager;
};
static void virLXCControllerFree(virLXCControllerPtr ctrl);
virLXCControllerStopInit(ctrl);
+ virSecurityManagerFree(ctrl->securityManager);
+
for (i = 0 ; i < ctrl->nveths ; i++)
VIR_FREE(ctrl->veths[i]);
VIR_FREE(ctrl->veths);
static int
virLXCControllerRun(virLXCControllerPtr ctrl,
- virSecurityManagerPtr securityDriver,
int monitor,
int client)
{
* marked as shared
*/
if (root) {
- mount_options = virSecurityManagerGetMountOptions(securityDriver, ctrl->def);
+ mount_options = virSecurityManagerGetMountOptions(ctrl->securityManager,
+ ctrl->def);
char *opts;
VIR_DEBUG("Setting up private /dev/pts");
goto cleanup;
if ((ctrl->initpid = lxcContainerStart(ctrl->def,
- securityDriver,
+ ctrl->securityManager,
ctrl->nveths,
ctrl->veths,
control[1],
};
int *ttyFDs = NULL;
size_t nttyFDs = 0;
- virSecurityManagerPtr securityDriver = NULL;
virLXCControllerPtr ctrl = NULL;
size_t i;
+ const char *securityDriver = "none";
if (setlocale(LC_ALL, "") == NULL ||
bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
break;
case 'S':
- if (!(securityDriver = virSecurityManagerNew(optarg,
- LXC_DRIVER_NAME,
- false, false, false))) {
- fprintf(stderr, "Cannot create security manager '%s'",
- optarg);
- goto cleanup;
- }
+ securityDriver = optarg;
break;
case 'h':
}
}
- if (securityDriver == NULL) {
- if (!(securityDriver = virSecurityManagerNew("none",
- LXC_DRIVER_NAME,
- false, false, false))) {
- fprintf(stderr, "%s: cannot initialize nop security manager", argv[0]);
- goto cleanup;
- }
- }
-
-
if (name == NULL) {
fprintf(stderr, "%s: missing --name argument for configuration\n", argv[0]);
goto cleanup;
ctrl->handshakeFd = handshakeFd;
+ if (!(ctrl->securityManager = virSecurityManagerNew(securityDriver,
+ LXC_DRIVER_NAME,
+ false, false, false)))
+ goto cleanup;
+
VIR_DEBUG("Security model %s type %s label %s imagelabel %s",
NULLSTR(ctrl->def->seclabel.model),
virDomainSeclabelTypeToString(ctrl->def->seclabel.type),
goto cleanup;
}
- rc = virLXCControllerRun(ctrl, securityDriver,
+ rc = virLXCControllerRun(ctrl,
monitor, client);
cleanup: