From 986babaab30279a4962648d03730bf1291d89f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 24 Jul 2020 07:44:58 +0100 Subject: util/oslib-win32: add qemu_get_host_physmem implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compile tested only. Signed-off-by: Alex Bennée Reviewed-by: Stefan Weil Message-Id: <20200724064509.331-6-alex.bennee@linaro.org> --- util/oslib-win32.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3