public DiskQuotaControl CreateDiskQuotaControl(IContainerDirectory dir) { var diskQuotaControl = new DiskQuotaControl(); diskQuotaControl.UserNameResolution = UserNameResolutionConstants.dqResolveNone; diskQuotaControl.Initialize(dir.Volume, true); return(diskQuotaControl); }
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)); }
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); }
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; }