Re: [PATCH v2 05/12] util/oslib-win32: add qemu_get_host_physmem implementation

2020-07-22 Thread Daniel P . Berrangé
On Wed, Jul 22, 2020 at 12:31:06PM +0100, Alex Bennée wrote: > > Stefan Weil writes: > > > Am 22.07.20 um 12:32 schrieb 罗勇刚(Yonggang Luo): > > > >> I would suggest use loadLibrary to retrieve the function, if not > >> available, then return 0 (For Win Xp and Vista); > > > > > > Maybe using Globa

Re: [PATCH v2 05/12] util/oslib-win32: add qemu_get_host_physmem implementation

2020-07-22 Thread Daniel P . Berrangé
On Wed, Jul 22, 2020 at 12:33:47PM +0100, Alex Bennée wrote: > > Stefan Weil writes: > > > Am 22.07.20 um 08:28 schrieb Alex Bennée: > > > >> It seems GetPhysicallyInstalledSystemMemory isn't available in the > >> MinGW headers so we have to declare it ourselves. Compile tested only. > > > > > >

Re: [PATCH v2 05/12] util/oslib-win32: add qemu_get_host_physmem implementation

2020-07-22 Thread Alex Bennée
Stefan Weil writes: > Am 22.07.20 um 08:28 schrieb Alex Bennée: > >> It seems GetPhysicallyInstalledSystemMemory isn't available in the >> MinGW headers so we have to declare it ourselves. Compile tested only. > > > It is available, at least for Mingw-w64 which I also use for cross > builds on

Re: [PATCH v2 05/12] util/oslib-win32: add qemu_get_host_physmem implementation

2020-07-22 Thread Alex Bennée
Stefan Weil writes: > Am 22.07.20 um 12:32 schrieb 罗勇刚(Yonggang Luo): > >> I would suggest use loadLibrary to retrieve the function, if not >> available, then return 0 (For Win Xp and Vista); > > > Maybe using GlobalMemoryStatusEx is a better alternative. It is > available since XP. I would we

Re: [PATCH v2 05/12] util/oslib-win32: add qemu_get_host_physmem implementation

2020-07-22 Thread Stefan Weil
Am 22.07.20 um 12:32 schrieb 罗勇刚(Yonggang Luo): > I would suggest use loadLibrary to retrieve the function, if not > available, then return 0 (For Win Xp and Vista); Maybe using GlobalMemoryStatusEx is a better alternative. It is available since XP. Regards, Stefan ||

Re: [PATCH v2 05/12] util/oslib-win32: add qemu_get_host_physmem implementation

2020-07-22 Thread Yonggang Luo
I would suggest use loadLibrary to retrieve the function, if not available, then return 0 (For Win Xp and Vista); On Wed, Jul 22, 2020 at 2:34 PM Alex Bennée wrote: > It seems GetPhysicallyInstalledSystemMemory isn't available in the > MinGW headers so we have to declare it ourselves. Compile te

Re: [PATCH v2 05/12] util/oslib-win32: add qemu_get_host_physmem implementation

2020-07-22 Thread Daniel P . Berrangé
On Wed, Jul 22, 2020 at 12:03:27PM +0200, Stefan Weil wrote: > Am 22.07.20 um 08:28 schrieb Alex Bennée: > > > It seems GetPhysicallyInstalledSystemMemory isn't available in the > > MinGW headers so we have to declare it ourselves. Compile tested only. > > > It is available, at least for Mingw-w

Re: [PATCH v2 05/12] util/oslib-win32: add qemu_get_host_physmem implementation

2020-07-22 Thread Stefan Weil
Am 22.07.20 um 08:28 schrieb Alex Bennée: > It seems GetPhysicallyInstalledSystemMemory isn't available in the > MinGW headers so we have to declare it ourselves. Compile tested only. It is available, at least for Mingw-w64 which I also use for cross builds on Debian, but is only included with _

Re: [PATCH v2 05/12] util/oslib-win32: add qemu_get_host_physmem implementation

2020-07-21 Thread Philippe Mathieu-Daudé
On 7/22/20 8:28 AM, Alex Bennée wrote: > It seems GetPhysicallyInstalledSystemMemory isn't available in the > MinGW headers so we have to declare it ourselves. Compile tested only. > > Cc: Stefan Weil > Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé > --- > util/oslib-win32.c

[PATCH v2 05/12] util/oslib-win32: add qemu_get_host_physmem implementation

2020-07-21 Thread Alex Bennée
It seems GetPhysicallyInstalledSystemMemory isn't available in the MinGW headers so we have to declare it ourselves. Compile tested only. Cc: Stefan Weil Signed-off-by: Alex Bennée --- util/oslib-win32.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/util/o