From 03579649063d669f9f57d534f74136befef98c62 Mon Sep 17 00:00:00 2001
From: Jordan Christiansen <xordspar0@gmail.com>
Date: Sat, 31 Oct 2020 09:32:52 -0500
Subject: Centralize cores and period/quota conversion code

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
---
 cmd/podman/common/specgen.go | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

(limited to 'cmd/podman')

diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index bd3e5fafd..ca1e25be1 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -25,11 +25,8 @@ func getCPULimits(c *ContainerCLIOpts) *specs.LinuxCPU {
 	cpu := &specs.LinuxCPU{}
 	hasLimits := false
 
-	const cpuPeriod = 100000
-
 	if c.CPUS > 0 {
-		quota := int64(c.CPUS * cpuPeriod)
-		period := uint64(cpuPeriod)
+		period, quota := util.CoresToPeriodAndQuota(c.CPUS)
 
 		cpu.Period = &period
 		cpu.Quota = &quota
-- 
cgit v1.2.3-54-g00ecf