From: Alex Bennée Date: Fri, 24 Jul 2020 06:44:58 +0000 (+0100) Subject: util/oslib-win32: add qemu_get_host_physmem implementation X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=986babaab30279a4962648d03730bf1291d89f93;p=qemu.git util/oslib-win32: add qemu_get_host_physmem implementation Compile tested only. Signed-off-by: Alex Bennée Reviewed-by: Stefan Weil Message-Id: <20200724064509.331-6-alex.bennee@linaro.org> --- diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 31030463cc..c654dafd93 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -831,6 +831,11 @@ char *qemu_get_host_name(Error **errp) size_t qemu_get_host_physmem(void) { - /* currently unimplemented */ + MEMORYSTATUSEX statex; + statex.dwLength = sizeof(statex); + + if (GlobalMemoryStatusEx(&statex)) { + return statex.ullTotalPhys; + } return 0; }