diff mbox series

[PULL,05/16] util/oslib-win32: add qemu_get_host_physmem implementation

Message ID 20200727122357.31263-6-alex.bennee@linaro.org
State Accepted
Commit 986babaab30279a4962648d03730bf1291d89f93
Headers show
Series various fixes for rc2 (semihosting, tcg, docker, tests/vm) | expand

Commit Message

Alex Bennée July 27, 2020, 12:23 p.m. UTC
Compile tested only.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Reviewed-by: Stefan Weil <sw@weilnetz.de>

Message-Id: <20200724064509.331-6-alex.bennee@linaro.org>

-- 
2.20.1
diff mbox series

Patch

diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 31030463cc9..c654dafd937 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;
 }