diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index e6369f8ffc8e5509b58d0fbcf4c3a40a7d876db4..691ddee9eb660e022e491e2bf2dda14665c70805 100644 --- a/src/lxc/lxc_fuse.c +++ b/src/lxc/lxc_fuse.c @@ -174,6 +174,14 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def, virDomainDefGetMemoryActual(def))) { virBufferAsprintf(new_meminfo, "MemFree: %8llu kB\n", (meminfo.memtotal - meminfo.memusage)); + } else if (STREQ(line, "MemAvailable") && + (virMemoryLimitIsSet(def->mem.hard_limit) || + virDomainDefGetMemoryActual(def))) { + /* MemAvailable is actually MemFree + SRReclaimable + + some other bits, but MemFree is the closest approximation + we have */ + virBufferAsprintf(new_meminfo, "MemAvailable: %8llu kB\n", + (meminfo.memtotal - meminfo.memusage)); } else if (STREQ(line, "Buffers")) { virBufferAsprintf(new_meminfo, "Buffers: %8d kB\n", 0); } else if (STREQ(line, "Cached")) {