Ejemplo n.º 1
0
        public DiskQuotaControl CreateDiskQuotaControl(IContainerDirectory dir)
        {
            var diskQuotaControl = new DiskQuotaControl();

            diskQuotaControl.UserNameResolution = UserNameResolutionConstants.dqResolveNone;
            diskQuotaControl.Initialize(dir.Volume, true);
            return(diskQuotaControl);
        }
Ejemplo n.º 2
0
        public IContainerDiskQuota CreateDiskQuotaControl(IContainerDirectory dir, string sid)
        {
            var diskQuotaControl = new DiskQuotaControl();

            diskQuotaControl.UserNameResolution = UserNameResolutionConstants.dqResolveNone;
            diskQuotaControl.Initialize(dir.Volume, true);
            return(new ContainerDiskQuota(diskQuotaControl, sid));
        }
Ejemplo n.º 3
0
        IContainer RestoreContainerFromPath(string containerPath)
        {
            var id = Path.GetFileName(containerPath);

            var user      = ContainerUser.Restore(userManager, id);
            var directory = ContainerDirectory.Restore(fileSystem, containerPath);

            var jobObjectName = id;
            var jobObject     = new JobObject(jobObjectName);

            var environment   = new Dictionary <string, string>();
            var processHelper = new ProcessHelper();

            var diskQuotaControl = new DiskQuotaControl();

            diskQuotaControl.UserNameResolution = UserNameResolutionConstants.dqResolveNone;
            diskQuotaControl.Initialize(directory.Volume, true);

            var dependencyHelper = new ContainerHostDependencyHelper();

            var container = new Container(
                id,
                id, // TODO: Recover the handle from container metadata
                user,
                directory,
                containerPropertiesService,
                tcpPortManager,
                jobObject,
                diskQuotaControl,
                processRunner,
                processRunner,
                processHelper,
                environment,
                dependencyHelper);

            return(container);
        }
Ejemplo n.º 4
0
        IContainer RestoreContainerFromPath(string containerPath)
        {
            var id = Path.GetFileName(containerPath);

            var user = ContainerUser.Restore(userManager, id);
            var directory = ContainerDirectory.Restore(fileSystem, containerPath);

            var jobObjectName = id;
            var jobObject = new JobObject(jobObjectName);

            var environment = new Dictionary<string, string>();
            var processHelper = new ProcessHelper();

            var diskQuotaControl = new DiskQuotaControl();
            diskQuotaControl.UserNameResolution = UserNameResolutionConstants.dqResolveNone;
            diskQuotaControl.Initialize(directory.Volume, true);

            var dependencyHelper = new ContainerHostDependencyHelper();

            var container = new Container(
                id,
                id, // TODO: Recover the handle from container metadata
                user,
                directory,
                containerPropertiesService,
                tcpPortManager,
                jobObject,
                diskQuotaControl,
                processRunner,
                processRunner,
                processHelper,
                environment,
                dependencyHelper);

            return container;
        }