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

[qemu-xen master] util/oslib-win32: add qemu_get_host_physmem implementation



commit 986babaab30279a4962648d03730bf1291d89f93
Author:     Alex Bennée <alex.bennee@xxxxxxxxxx>
AuthorDate: Fri Jul 24 07:44:58 2020 +0100
Commit:     Alex Bennée <alex.bennee@xxxxxxxxxx>
CommitDate: Mon Jul 27 09:40:16 2020 +0100

    util/oslib-win32: add qemu_get_host_physmem implementation
    
    Compile tested only.
    
    Signed-off-by: Alex Bennée <alex.bennee@xxxxxxxxxx>
    Reviewed-by: Stefan Weil <sw@xxxxxxxxxxx>
    Message-Id: <20200724064509.331-6-alex.bennee@xxxxxxxxxx>
---
 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;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.