mirror of
				https://github.com/containers/podman.git
				synced 2025-10-28 20:03:38 +08:00 
			
		
		
		
	podman cgroup enhancement
currently, setting any sort of resource limit in a pod does nothing. With the newly refactored creation process in c/common, podman ca now set resources at a pod level meaning that resource related flags can now be exposed to podman pod create. cgroupfs and systemd are both supported with varying completion. cgroupfs is a much simpler process and one that is virtually complete for all resource types, the flags now just need to be added. systemd on the other hand has to be handeled via the dbus api meaning that the limits need to be passed as recognized properties to systemd. The properties added so far are the ones that podman pod create supports as well as `cpuset-mems` as this will be the next flag I work on. Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
		
							
								
								
									
										15
									
								
								vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								vendor/github.com/opencontainers/runc/libcontainer/cgroups/cgroups.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -1,9 +1,24 @@ | ||||
| package cgroups | ||||
|  | ||||
| import ( | ||||
| 	"errors" | ||||
|  | ||||
| 	"github.com/opencontainers/runc/libcontainer/configs" | ||||
| ) | ||||
|  | ||||
| var ( | ||||
| 	// ErrDevicesUnsupported is an error returned when a cgroup manager | ||||
| 	// is not configured to set device rules. | ||||
| 	ErrDevicesUnsupported = errors.New("cgroup manager is not configured to set device rules") | ||||
|  | ||||
| 	// DevicesSetV1 and DevicesSetV2 are functions to set devices for | ||||
| 	// cgroup v1 and v2, respectively. Unless libcontainer/cgroups/devices | ||||
| 	// package is imported, it is set to nil, so cgroup managers can't | ||||
| 	// manage devices. | ||||
| 	DevicesSetV1 func(path string, r *configs.Resources) error | ||||
| 	DevicesSetV2 func(path string, r *configs.Resources) error | ||||
| ) | ||||
|  | ||||
| type Manager interface { | ||||
| 	// Apply creates a cgroup, if not yet created, and adds a process | ||||
| 	// with the specified pid into that cgroup.  A special value of -1 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 cdoern
					cdoern