[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 05/16] util/oslib-win32: add qemu_get_host_physmem impleme
From: |
Stefan Weil |
Subject: |
Re: [PATCH v3 05/16] util/oslib-win32: add qemu_get_host_physmem implementation |
Date: |
Fri, 24 Jul 2020 08:51:58 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Am 24.07.20 um 08:44 schrieb Alex Bennée:
> Compile tested only.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Stefan Weil <sw@weilnetz.de>
>
> ---
> v2
> - used more widely available GlobalMemoryStatusEx
> - dropped Phillipe's r-b due to the change
> ---
> 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 31030463cc9..a74ee5a3aa7 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;
> }
Thanks.
The logic must be reversed, as GlobalMemoryStatusEx returns a nonzero
value when it succeeded.
When that is fixed, you may add
Reviewed-by: Stefan Weil <sw@weilnetz.de>
- [PATCH v3 00/16] candidate fixes for 5.1-rc1 (testing, semihosting, OOM tcg, x86 fpu), Alex Bennée, 2020/07/24
- [PATCH v3 03/16] semihosting: don't send the trailing '\0', Alex Bennée, 2020/07/24
- [PATCH v3 01/16] shippable: add one more qemu to registry url, Alex Bennée, 2020/07/24
- [PATCH v3 02/16] semihosting: defer connect_chardevs a little more to use serialx, Alex Bennée, 2020/07/24
- [PATCH v3 04/16] util: add qemu_get_host_physmem utility function, Alex Bennée, 2020/07/24
- [PATCH v3 06/16] accel/tcg: better handle memory constrained systems, Alex Bennée, 2020/07/24
- [PATCH v3 05/16] util/oslib-win32: add qemu_get_host_physmem implementation, Alex Bennée, 2020/07/24
- Re: [PATCH v3 05/16] util/oslib-win32: add qemu_get_host_physmem implementation,
Stefan Weil <=
- [PATCH v3 08/16] linux-user: don't use MAP_FIXED in pgd_find_hole_fallback, Alex Bennée, 2020/07/24
- [PATCH v3 10/16] tests/docker: fix binfmt_misc image building, Alex Bennée, 2020/07/24
- [PATCH v3 07/16] target/i386: floatx80: avoid compound literals in static initializers, Alex Bennée, 2020/07/24
- [PATCH v3 12/16] linux-user: fix clock_nanosleep(), Alex Bennée, 2020/07/24
- [PATCH v3 16/16] tests/vm: add shutdown timeout in basevm.py, Alex Bennée, 2020/07/24
- [PATCH v3 11/16] tests/docker: add support for DEB_KEYRING, Alex Bennée, 2020/07/24
- [PATCH v3 14/16] python/qemu: Cleanup changes to ConsoleSocket, Alex Bennée, 2020/07/24