From 7523beff41eca212794e902afa1a614b2672e245 Mon Sep 17 00:00:00 2001 From: David Calavera Date: Fri, 10 Apr 2015 17:07:05 -0700 Subject: [PATCH] Log memory swap capabilities properly. Check whether the swap limit capabilities are disabled or not only when memory swap is set to greater than 0. Signed-off-by: David Calavera --- daemon/container.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/container.go b/daemon/container.go index a0dd36c8db..e831f07a52 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -1286,7 +1286,7 @@ func (container *Container) verifyDaemonSettings() { logrus.Warnf("Your kernel does not support memory limit capabilities. Limitation discarded.") container.hostConfig.Memory = 0 } - if container.hostConfig.Memory > 0 && !container.daemon.sysInfo.SwapLimit { + if container.hostConfig.Memory > 0 && container.hostConfig.MemorySwap != -1 && !container.daemon.sysInfo.SwapLimit { logrus.Warnf("Your kernel does not support swap limit capabilities. Limitation discarded.") container.hostConfig.MemorySwap = -1 }