qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Alex Bennée
Subject: [PULL 05/16] util/oslib-win32: add qemu_get_host_physmem implementation
Date: Mon, 27 Jul 2020 13:23:46 +0100

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>

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;
 }
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]