diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-12-17 15:07:45 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-12-17 15:07:45 -0800 |
commit | 725e73eed081a5a063054511da63d0771f6705a1 (patch) | |
tree | bb1ea213d4284147751250c3212e8240cd8f004c /runsc/boot/config.go | |
parent | 91f1ac731933ac1fe0f9ef30f4c9d06fa4031021 (diff) | |
parent | 67f678be27b3f4545d41539bd6855527da53a250 (diff) |
Merge pull request #1393 from ernado:cpu-num-from-quota
PiperOrigin-RevId: 286068605
Diffstat (limited to 'runsc/boot/config.go')
-rw-r--r-- | runsc/boot/config.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runsc/boot/config.go b/runsc/boot/config.go index 72a33534f..a878bc2ce 100644 --- a/runsc/boot/config.go +++ b/runsc/boot/config.go @@ -250,6 +250,12 @@ type Config struct { // multiple tests are run in parallel, since there is no way to pass // parameters to the runtime from docker. TestOnlyTestNameEnv string + + // CPUNumFromQuota sets CPU number count to available CPU quota, using + // least integer value greater than or equal to quota. + // + // E.g. 0.2 CPU quota will result in 1, and 1.9 in 2. + CPUNumFromQuota bool } // ToFlags returns a slice of flags that correspond to the given Config. @@ -282,6 +288,9 @@ func (c *Config) ToFlags() []string { "--software-gso=" + strconv.FormatBool(c.SoftwareGSO), "--overlayfs-stale-read=" + strconv.FormatBool(c.OverlayfsStaleRead), } + if c.CPUNumFromQuota { + f = append(f, "--cpu-num-from-quota") + } // Only include these if set since it is never to be used by users. if c.TestOnlyAllowRunAsCurrentUserWithoutChroot { f = append(f, "--TESTONLY-unsafe-nonroot=true") |