[PATCH] guest agent: Fixes for windows guest agent building on msys2/mingw

Yonggang Luo posted 1 patch 3 years, 7 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200915163343.1100-1-luoyonggang@gmail.com
configure | 1 +
1 file changed, 1 insertion(+)
[PATCH] guest agent: Fixes for windows guest agent building on msys2/mingw
Posted by Yonggang Luo 3 years, 7 months ago
error message:
"cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include" "-IC:/CI-Tools/msys64/mingw64/include/glib-2.0" "-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror" "-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-Wstrict-prototypes" "-Wredundant-decls" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wold-style-declaration" "-Wold-style-definition" "-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined" "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong" "-iquote" "/c/work/xemu/qemu/tcg/i386" "-iquote" "." "-iquote" "/c/work/xemu/qemu" "-iquote" "/c/work/xemu/qemu/accel/tcg" "-iquote" "/c/work/xemu/qemu/include" "-iquote" "/c/work/xemu/qemu/disas/libvixl" "-pthread" "-mms-bitfields" -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP
../qga/commands-win32.c:62:24: error: redundant redeclaration of 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
   62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../qga/commands-win32.c:26:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note: previous declaration of 'CM_Get_DevNode_PropertyW' was here
  840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj] 错误 1 (已忽略)

This error comes from qemu configure didn't add predefined macro -DUNICODE -D_UNICODE in QEMU_CFLAGS,
and these too macro are standard config for win32 if using windows wide api.

in cfgmgr32.h
  CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
#ifdef UNICODE
#define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW
#endif

macro CM_Get_DevNode_Property defined only when UNICODE are defined.
and in win32, UNICODE and _UNICODE should be defined at the same time

#endif

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 9f141891ea..f5d661af4a 100755
--- a/configure
+++ b/configure
@@ -812,6 +812,7 @@ MINGW32*)
   mingw32="yes"
   hax="yes"
   whpx=""
+  QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS"
   vhost_user="no"
   audio_possible_drivers="dsound sdl"
   if check_include dsound.h; then
-- 
2.28.0.windows.1


Re: [PATCH] guest agent: Fixes for windows guest agent building on msys2/mingw
Posted by Philippe Mathieu-Daudé 3 years, 7 months ago
On 9/15/20 6:33 PM, Yonggang Luo wrote:
> error message:
> "cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include" "-IC:/CI-Tools/msys64/mingw64/include/glib-2.0" "-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror" "-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-Wstrict-prototypes" "-Wredundant-decls" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wold-style-declaration" "-Wold-style-definition" "-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined" "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong" "-iquote" "/c/work/xemu/qemu/tcg/i386" "-iquote" "." "-iquote" "/c/work/xemu/qemu" "-iquote" "/c/work/xemu/qemu/accel/tcg" "-iquote" "/c/work/xemu/qemu/include" "-iquote" "/c/work/xemu/qemu/disas/libvixl" "-pthread" "-mms-bitfields" -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP
> ../qga/commands-win32.c:62:24: error: redundant redeclaration of 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
>    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
>       |                        ^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from ../qga/commands-win32.c:26:
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note: previous declaration of 'CM_Get_DevNode_PropertyW' was here
>   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
>       |                          ^~~~~~~~~~~~~~~~~~~~~~~~
> cc1.exe: all warnings being treated as errors
> make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj] 错误 1 (已忽略)
> 
> This error comes from qemu configure didn't add predefined macro -DUNICODE -D_UNICODE in QEMU_CFLAGS,
> and these too macro are standard config for win32 if using windows wide api.
> 
> in cfgmgr32.h
>   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
> #ifdef UNICODE
> #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW
> #endif
> 
> macro CM_Get_DevNode_Property defined only when UNICODE are defined.
> and in win32, UNICODE and _UNICODE should be defined at the same time
> 
> #endif
> 
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> ---
>  configure | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configure b/configure
> index 9f141891ea..f5d661af4a 100755
> --- a/configure
> +++ b/configure
> @@ -812,6 +812,7 @@ MINGW32*)
>    mingw32="yes"
>    hax="yes"
>    whpx=""
> +  QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS"

What about declaring them in include/qemu/osdep.h
instead?

-- >8 --
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 412962d91a2..cd5cedc0b21 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -74,6 +74,12 @@ extern int daemon(int, int);
 /* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
 #ifdef __MINGW32__
 #define __USE_MINGW_ANSI_STDIO 1
+#ifndef UNICODE
+#define UNICODE
+#endif
+#ifndef _UNICODE
+#define _UNICODE
+#endif
 #endif

 #include <stdarg.h>
---

>    vhost_user="no"
>    audio_possible_drivers="dsound sdl"
>    if check_include dsound.h; then
> 

Re: [PATCH] guest agent: Fixes for windows guest agent building on msys2/mingw
Posted by 罗勇刚 (Yonggang Luo) 3 years, 7 months ago
On Wed, Sep 16, 2020 at 12:41 AM Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:
>
> On 9/15/20 6:33 PM, Yonggang Luo wrote:
> > error message:
> > "cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi" "-Itrace"
"-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include"
"-IC:/CI-Tools/msys64/mingw64/include/glib-2.0"
"-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include"
"-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror"
"-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64"
"-D_LARGEFILE_SOURCE" "-Wstrict-prototypes" "-Wredundant-decls" "-Wundef"
"-Wwrite-strings" "-Wmissing-prototypes" "-fno-strict-aliasing"
"-fno-common" "-fwrapv" "-Wold-style-declaration" "-Wold-style-definition"
"-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self"
"-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels"
"-Wexpansion-to-defined" "-Wno-missing-include-dirs"
"-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong"
"-iquote" "/c/work/xemu/qemu/tcg/i386" "-iquote" "." "-iquote"
"/c/work/xemu/qemu" "-iquote" "/c/work/xemu/qemu/accel/tcg" "-iquote"
"/c/work/xemu/qemu/include" "-iquote" "/c/work/xemu/qemu/disas/libvixl"
"-pthread" "-mms-bitfields" -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj
-MF "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o
qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP
> > ../qga/commands-win32.c:62:24: error: redundant redeclaration of
'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
> >    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
> >       |                        ^~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from ../qga/commands-win32.c:26:
> >
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26:
note: previous declaration of 'CM_Get_DevNode_PropertyW' was here
> >   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST
dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE
PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
> >       |                          ^~~~~~~~~~~~~~~~~~~~~~~~
> > cc1.exe: all warnings being treated as errors
> > make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj] 错误 1
(已忽略)
> >
> > This error comes from qemu configure didn't add predefined macro
-DUNICODE -D_UNICODE in QEMU_CFLAGS,
> > and these too macro are standard config for win32 if using windows wide
api.
> >
> > in cfgmgr32.h
> >   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,
const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE
PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
> > #ifdef UNICODE
> > #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW
> > #endif
> >
> > macro CM_Get_DevNode_Property defined only when UNICODE are defined.
> > and in win32, UNICODE and _UNICODE should be defined at the same time
> >
> > #endif
> >
> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> > ---
> >  configure | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/configure b/configure
> > index 9f141891ea..f5d661af4a 100755
> > --- a/configure
> > +++ b/configure
> > @@ -812,6 +812,7 @@ MINGW32*)
> >    mingw32="yes"
> >    hax="yes"
> >    whpx=""
> > +  QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS"
>
> What about declaring them in include/qemu/osdep.h
> instead?
That's a good idea.
But more compiling error warns me that the windows version of qemu are not
in a good situation.
On Win32, all API should call the wide version so that support for Unicode
properly.
But obviously the currently qemu didn't do that

```

Compiling C object qga/qemu-ga.exe.p/commands-win32.c.obj
In file included from ../util/qemu-sockets.c:27:
../util/qemu-sockets.c: In function 'inet_listen_saddr':
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 8 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../util/qemu-sockets.c:274:9: note: in expansion of macro 'error_setg'
  274 |         error_setg(errp, "address resolution failed for %s:%s: %s",
      |         ^~~~~~~~~~
../util/qemu-sockets.c: In function 'inet_parse_connect_saddr':
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 8 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../util/qemu-sockets.c:429:9: note: in expansion of macro 'error_setg'
  429 |         error_setg(errp, "address resolution failed for %s:%s: %s",
      |         ^~~~~~~~~~
../util/qemu-sockets.c: In function 'inet_dgram_saddr':
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 8 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../util/qemu-sockets.c:518:9: note: in expansion of macro 'error_setg'
  518 |         error_setg(errp, "address resolution failed for %s:%s: %s",
addr, port,
      |         ^~~~~~~~~~
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 8 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../util/qemu-sockets.c:544:9: note: in expansion of macro 'error_setg'
  544 |         error_setg(errp, "address resolution failed for %s:%s: %s",
addr, port,
      |         ^~~~~~~~~~
../util/qemu-sockets.c: In function 'socket_sockaddr_to_address_inet':
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 6 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../util/qemu-sockets.c:1235:9: note: in expansion of macro 'error_setg'
 1235 |         error_setg(errp, "Cannot format numeric socket address: %s",
      |         ^~~~~~~~~~
In file included from ../io/dns-resolver.c:26:
../io/dns-resolver.c: In function 'qio_dns_resolver_lookup_sync_inet':
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 8 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../io/dns-resolver.c:93:9: note: in expansion of macro 'error_setg'
   93 |         error_setg(errp, "address resolution failed for %s:%s: %s",
      |         ^~~~~~~~~~
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:756:io/libio.fa.p/dns-resolver.c.obj] 错误 1 (已忽略)
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:697:libqemuutil.a.p/util_qemu-sockets.c.obj] 错误 1
(已忽略)
Linking static target io/libio.fa
C:\CI-Tools\msys64\mingw64\bin\ar.exe: io/libio.fa.p/dns-resolver.c.obj: No
such file or directory
make: [Makefile.ninja:764:io/libio.fa] 错误 1 (已忽略)
../net/tap-win32.c: In function 'is_tap_win32_dev':
../net/tap-win32.c:62:21: error: passing argument 2 of 'RegOpenKeyExW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
   62 | #define ADAPTER_KEY
"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                     |
      |                     const char *
../net/tap-win32.c:62:21: note: in definition of macro 'ADAPTER_KEY'
   62 | #define ADAPTER_KEY
"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
      |                                                 ~~~~~~~~^~~~~~~~
../net/tap-win32.c:229:13: error: passing argument 3 of 'RegEnumKeyExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  229 |             enum_name,
      |             ^~~~~~~~~
      |             |
      |             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD
dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR
lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
      |
~~~~~~~^~~~~~
../net/tap-win32.c:247:13: error: passing argument 2 of 'RegOpenKeyExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  247 |             unit_string,
      |             ^~~~~~~~~~~
      |             |
      |             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
      |                                                 ~~~~~~~~^~~~~~~~
../net/tap-win32.c:258:17: error: passing argument 2 of 'RegQueryValueExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  258 |                 component_id_string,
      |                 ^~~~~~~~~~~~~~~~~~~
      |                 |
      |                 char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:203:60:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  203 |   WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR
lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD
lpcbData);
      |
 ~~~~~~~~^~~~~~~~~~~
../net/tap-win32.c:268:21: error: passing argument 2 of 'RegQueryValueExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  268 |                     net_cfg_instance_id_string,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                     |
      |                     char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:203:60:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  203 |   WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR
lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD
lpcbData);
      |
 ~~~~~~~~^~~~~~~~~~~
../net/tap-win32.c: In function 'get_device_guid':
../net/tap-win32.c:64:33: error: passing argument 2 of 'RegOpenKeyExW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
   64 | #define NETWORK_CONNECTIONS_KEY
"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char *
../net/tap-win32.c:64:33: note: in definition of macro
'NETWORK_CONNECTIONS_KEY'
   64 | #define NETWORK_CONNECTIONS_KEY
"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
      |                                                 ~~~~~~~~^~~~~~~~
../net/tap-win32.c:328:13: error: passing argument 3 of 'RegEnumKeyExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  328 |             enum_name,
      |             ^~~~~~~~~
      |             |
      |             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD
dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR
lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
      |
~~~~~~~^~~~~~
../net/tap-win32.c:348:13: error: passing argument 2 of 'RegOpenKeyExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  348 |             connection_string,
      |             ^~~~~~~~~~~~~~~~~
      |             |
      |             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
      |                                                 ~~~~~~~~^~~~~~~~
../net/tap-win32.c:357:17: error: passing argument 2 of 'RegQueryValueExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  357 |                 name_string,
      |                 ^~~~~~~~~~~
      |                 |
      |                 const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:203:60:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  203 |   WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR
lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD
lpcbData);
      |
 ~~~~~~~~^~~~~~~~~~~
../net/tap-win32.c: In function 'tap_win32_open':
../net/tap-win32.c:626:9: error: passing argument 1 of 'CreateFileW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  626 |         device_path,
      |         ^~~~~~~~~~~
      |         |
      |         char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../chardev/char-win.c: In function 'win_chr_serial_init':
../chardev/char-win.c:96:26: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
   96 |     s->file = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0,
NULL,
      |                          ^~~~~~~~
      |                          |
      |                          const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../chardev/char-win.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../chardev/char-win.c:111:26: error: passing argument 1 of
'GetDefaultCommConfigW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  111 |     GetDefaultCommConfig(filename, &comcfg, &size);
      |                          ^~~~~~~~
      |                          |
      |                          const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../chardev/char-win.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:2394:60:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
 2394 |   WINBASEAPI WINBOOL WINAPI GetDefaultCommConfigW (LPCWSTR
lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize);
      |                                                    ~~~~~~~~^~~~~~~~
../chardev/char-win.c:113:22: error: passing argument 1 of
'CommConfigDialogW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  113 |     CommConfigDialog(filename, NULL, &comcfg);
      |                      ^~~~~~~~
      |                      |
      |                      const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../chardev/char-win.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:2392:56:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
 2392 |   WINBASEAPI WINBOOL WINAPI CommConfigDialogW (LPCWSTR lpszName,
HWND hWnd, LPCOMMCONFIG lpCC);
      |                                                ~~~~~~~~^~~~~~~~
cc1.exe: all warnings being treated as errors
cc1.exe: all warnings being treated as errors
../chardev/char-file.c: In function 'qmp_chardev_open_file':
../chardev/char-file.c:63:26: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
   63 |     out = CreateFile(file->out, accessmode, FILE_SHARE_READ, NULL,
flags,
      |                      ~~~~^~~~~
      |                          |
      |                          char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../chardev/char-file.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../block.c: In function 'get_tmp_filename':
../block.c:757:35: error: passing argument 2 of 'GetTempPathW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  757 |     return (GetTempPath(MAX_PATH, temp_dir)
      |                                   ^~~~~~~~
      |                                   |
      |                                   char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:188:69:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  188 |   WINBASEAPI DWORD WINAPI GetTempPathW (DWORD nBufferLength, LPWSTR
lpBuffer);
      |
 ~~~~~~~^~~~~~~~
../block.c:758:32: error: passing argument 1 of 'GetTempFileNameW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  758 |             && GetTempFileName(temp_dir, "qem", 0, filename)
      |                                ^~~~~~~~
      |                                |
      |                                char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:127:52:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  127 |   WINBASEAPI UINT WINAPI GetTempFileNameW (LPCWSTR lpPathName,
LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);
      |                                            ~~~~~~~~^~~~~~~~~~
../block.c:758:42: error: passing argument 2 of 'GetTempFileNameW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  758 |             && GetTempFileName(temp_dir, "qem", 0, filename)
      |                                          ^~~~~
      |                                          |
      |                                          const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:127:72:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  127 |   WINBASEAPI UINT WINAPI GetTempFileNameW (LPCWSTR lpPathName,
LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);
      |
 ~~~~~~~~^~~~~~~~~~~~~~
../block.c:758:52: error: passing argument 4 of 'GetTempFileNameW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  758 |             && GetTempFileName(temp_dir, "qem", 0, filename)
      |                                                    ^~~~~~~~
      |                                                    |
      |                                                    char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:127:109:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  127 |   WINBASEAPI UINT WINAPI GetTempFileNameW (LPCWSTR lpPathName,
LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);
      |
                                 ~~~~~~~^~~~~~~~~~~~~~
../chardev/char-pipe.c: In function 'win_chr_pipe_init':
../chardev/char-pipe.c:66:31: error: passing argument 1 of
'CreateNamedPipeW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   66 |     s->file = CreateNamedPipe(openname,
      |                               ^~~~~~~~
      |                               |
      |                               char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:26,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../chardev/char-pipe.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h:28:54:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   28 |   WINBASEAPI HANDLE WINAPI CreateNamedPipeW (LPCWSTR lpName, DWORD
dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize,
DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES
lpSecurityAttributes);
      |                                              ~~~~~~~~^~~~~~
../qga/service-win32.c: In function 'printf_win_error':
../qga/service-win32.c:28:9: error: passing argument 5 of 'FormatMessageW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
   28 |         (char *)&message, 0,
      |         ^~~~~~~~~~~~~~~~
      |         |
      |         char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/service-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1366:122:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
 1366 |   WINBASEAPI DWORD WINAPI FormatMessageW (DWORD dwFlags, LPCVOID
lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD
nSize, va_list *Arguments);
      |
                                              ~~~~~~~^~~~~~~~
../qga/service-win32.c: In function 'ga_install_service':
../qga/service-win32.c:107:34: error: initialization of 'WCHAR *' {aka
'short unsigned int *'} from incompatible pointer type 'char *'
[-Werror=incompatible-pointer-types]
  107 |     SERVICE_DESCRIPTION desc = { (char *)QGA_SERVICE_DESCRIPTION };
      |                                  ^
../qga/service-win32.c:107:34: note: (near initialization for
'desc.lpDescription')
../qga/service-win32.c:118:43: error: passing argument 1 of
'win_escape_arg' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  118 |                            win_escape_arg(module_fname, esc));
      |                                           ^~~~~~~~~~~~
      |                                           |
      |                                           TCHAR * {aka short
unsigned int *}
../qga/service-win32.c:42:47: note: expected 'const char *' but argument is
of type 'TCHAR *' {aka 'short unsigned int *'}
   42 | static const char *win_escape_arg(const char *to_escape, GString
*buffer)
      |                                   ~~~~~~~~~~~~^~~~~~~~~
In file included from ../qga/service-win32.c:15:
C:/work/xemu/qemu/qga/service-win32.h:20:34: error: passing argument 2 of
'CreateServiceW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   20 | #define QGA_SERVICE_NAME         "qemu-ga"
      |                                  ^~~~~~~~~
      |                                  |
      |                                  const char *
../qga/service-win32.c:140:38: note: in expansion of macro
'QGA_SERVICE_NAME'
  140 |     service = CreateService(manager, QGA_SERVICE_NAME,
QGA_SERVICE_DISPLAY_NAME,
      |                                      ^~~~~~~~~~~~~~~~
make: [Makefile.ninja:767:chardev/libchardev.fa.p/char-win.c.obj] 错误 1 (已忽略)
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/service-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:289:74:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  289 |   WINADVAPI SC_HANDLE WINAPI CreateServiceW(SC_HANDLE
hSCManager,LPCWSTR lpServiceName,LPCWSTR lpDisplayName,DWORD
dwDesiredAccess,DWORD dwServiceType,DWORD dwStartType,DWORD
dwErrorControl,LPCWSTR lpBinaryPathName,LPCWSTR lpLoadOrderGroup,LPDWORD
lpdwTagId,LPCWSTR lpDependencies,LPCWSTR lpServiceStartName,LPCWSTR
lpPassword);
      |
 ~~~~~~~~^~~~~~~~~~~~~
In file included from ../qga/service-win32.c:15:
C:/work/xemu/qemu/qga/service-win32.h:19:34: error: passing argument 3 of
'CreateServiceW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   19 | #define QGA_SERVICE_DISPLAY_NAME "QEMU Guest Agent"
      |                                  ^~~~~~~~~~~~~~~~~~
      |                                  |
      |                                  const char *
../qga/service-win32.c:140:56: note: in expansion of macro
'QGA_SERVICE_DISPLAY_NAME'
  140 |     service = CreateService(manager, QGA_SERVICE_NAME,
QGA_SERVICE_DISPLAY_NAME,
      |
 ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/service-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:289:96:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  289 |   WINADVAPI SC_HANDLE WINAPI CreateServiceW(SC_HANDLE
hSCManager,LPCWSTR lpServiceName,LPCWSTR lpDisplayName,DWORD
dwDesiredAccess,DWORD dwServiceType,DWORD dwStartType,DWORD
dwErrorControl,LPCWSTR lpBinaryPathName,LPCWSTR lpLoadOrderGroup,LPDWORD
lpdwTagId,LPCWSTR lpDependencies,LPCWSTR lpServiceStartName,LPCWSTR
lpPassword);
      |
                   ~~~~~~~~^~~~~~~~~~~~~
../qga/service-win32.c:142:38: error: passing argument 8 of
'CreateServiceW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  142 |         SERVICE_ERROR_NORMAL, cmdline->str, NULL, NULL, NULL, NULL,
NULL);
      |                               ~~~~~~~^~~~~
      |                                      |
      |                                      gchar * {aka char *}
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/service-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:289:199:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'gchar *' {aka 'char *'}
  289 |   WINADVAPI SC_HANDLE WINAPI CreateServiceW(SC_HANDLE
hSCManager,LPCWSTR lpServiceName,LPCWSTR lpDisplayName,DWORD
dwDesiredAccess,DWORD dwServiceType,DWORD dwStartType,DWORD
dwErrorControl,LPCWSTR lpBinaryPathName,LPCWSTR lpLoadOrderGroup,LPDWORD
lpdwTagId,LPCWSTR lpDependencies,LPCWSTR lpServiceStartName,LPCWSTR
lpPassword);
      |

                                              ~~~~~~~~^~~~~~~~~~~~~~~~
In file included from ../qga/service-win32.c:15:
../qga/service-win32.c: In function 'ga_uninstall_service':
C:/work/xemu/qemu/qga/service-win32.h:20:34: error: passing argument 2 of
'OpenServiceW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   20 | #define QGA_SERVICE_NAME         "qemu-ga"
      |                                  ^~~~~~~~~
      |                                  |
      |                                  const char *
../qga/service-win32.c:173:36: note: in expansion of macro
'QGA_SERVICE_NAME'
  173 |     service = OpenService(manager, QGA_SERVICE_NAME, DELETE);
      |                                    ^~~~~~~~~~~~~~~~
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/service-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:306:72:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  306 |   WINADVAPI SC_HANDLE WINAPI OpenServiceW(SC_HANDLE
hSCManager,LPCWSTR lpServiceName,DWORD dwDesiredAccess);
      |
 ~~~~~~~~^~~~~~~~~~~~~
../qga/channel-win32.c: In function 'ga_channel_open':
../qga/channel-win32.c:301:28: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  301 |     c->handle = CreateFile(newpath, GENERIC_READ | GENERIC_WRITE,
0, NULL,
      |                            ^~~~~~~
      |                            |
      |                            gchar * {aka char *}
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/channel-win32.c:1:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'gchar *' {aka 'char *'}
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
make: [Makefile.ninja:952:libcommon.fa.p/net_tap-win32.c.obj] 错误 1 (已忽略)
cc1.exe: all warnings being treated as errors
cc1.exe: all warnings being treated as errors
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:773:chardev/libchardev.fa.p/char-file.c.obj] 错误 1
(已忽略)
../block/file-win32.c: In function 'raw_probe_alignment':
../block/file-win32.c:250:27: error: passing argument 1 of
'GetDiskFreeSpaceW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  250 |         GetDiskFreeSpace(s->drive_path, &sectorsPerCluster,
      |                          ~^~~~~~~~~~~~
      |                           |
      |                           char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:74:56:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   74 |   WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceW (LPCWSTR
lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector,
LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);
      |
 ~~~~~~~~^~~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors
../block/file-win32.c: In function 'raw_open':
../block/file-win32.c:390:39: error: passing argument 2 of
'GetCurrentDirectoryW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  390 |         GetCurrentDirectory(MAX_PATH, buf);
      |                                       ^~~
      |                                       |
      |                                       char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:28,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/processenv.h:23:77:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
   23 |   WINBASEAPI DWORD WINAPI GetCurrentDirectoryW (DWORD
nBufferLength, LPWSTR lpBuffer);
      |
 ~~~~~~~^~~~~~~~
../block/file-win32.c:394:27: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  394 |     s->hfile = CreateFile(filename, access_flags,
      |                           ^~~~~~~~
      |                           |
      |                           const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../block/file-win32.c: In function 'raw_getlength':
../block/file-win32.c:540:34: error: passing argument 1 of
'GetDiskFreeSpaceExW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  540 |         if (!GetDiskFreeSpaceEx(s->drive_path, &available, &total,
&total_free))
      |                                 ~^~~~~~~~~~~~
      |                                  |
      |                                  char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:174:58:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  174 |   WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceExW (LPCWSTR
lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller,
PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER
lpTotalNumberOfFreeBytes);
      |
 ~~~~~~~~^~~~~~~~~~~~~~~
make: [Makefile.ninja:1428:qga/qemu-ga.exe.p/service-win32.c.obj] 错误 1 (已忽略)
../block/file-win32.c: In function 'raw_get_allocated_file_size':
../block/file-win32.c:566:59: error: passing argument 1 of
'GetModuleHandleW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  566 |         (get_compressed_t)
GetProcAddress(GetModuleHandle("kernel32"),
      |                                                           ^~~~~~~~~~
      |                                                           |
      |                                                           const
char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:140:53:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  140 | WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);
      |                                             ~~~~~~~~^~~~~~~~~~~~
make: [Makefile.ninja:777:chardev/libchardev.fa.p/char-pipe.c.obj] 错误 1
(已忽略)
../block/file-win32.c: In function 'find_cdrom':
../block/file-win32.c:684:44: error: passing argument 2 of
'GetLogicalDriveStringsW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  684 |     GetLogicalDriveStrings(sizeof(drives), drives);
      |                                            ^~~~~~
      |                                            |
      |                                            char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:90:80:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
   90 |   WINBASEAPI DWORD WINAPI GetLogicalDriveStringsW (DWORD
nBufferLength, LPWSTR lpBuffer);
      |
    ~~~~~~~^~~~~~~~
../block/file-win32.c:686:29: error: passing argument 1 of 'GetDriveTypeW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  686 |         type = GetDriveType(pdrv);
      |                             ^~~~
      |                             |
      |                             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:76:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   76 |   WINBASEAPI UINT WINAPI GetDriveTypeW (LPCWSTR lpRootPathName);
      |                                         ~~~~~~~~^~~~~~~~~~~~~~
../block/file-win32.c:693:25: error: passing argument 1 of 'lstrlenW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  693 |         pdrv += lstrlen(pdrv) + 1;
      |                         ^~~~
      |                         |
      |                         char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1430:43:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
 1430 |   WINBASEAPI int WINAPI lstrlenW (LPCWSTR lpString);
      |                                   ~~~~~~~~^~~~~~~~
../block/file-win32.c: In function 'find_device_type':
../block/file-win32.c:709:30: error: passing argument 1 of 'GetDriveTypeW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  709 |         type = GetDriveType(s->drive_path);
      |                             ~^~~~~~~~~~~~
      |                              |
      |                              char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:76:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   76 |   WINBASEAPI UINT WINAPI GetDriveTypeW (LPCWSTR lpRootPathName);
      |                                         ~~~~~~~~^~~~~~~~~~~~~~
../block/file-win32.c: In function 'hdev_open':
../block/file-win32.c:799:27: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  799 |     s->hfile = CreateFile(filename, access_flags,
      |                           ^~~~~~~~
      |                           |
      |                           const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../qga/vss-win32.c: In function 'call_vss_provider_func':
../qga/vss-win32.c:38:23: error: passing argument 5 of 'FormatMessageW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
   38 |                       (char *)&msg, 0, NULL);
      |                       ^~~~~~~~~~~~
      |                       |
      |                       char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/vss-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1366:122:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
 1366 |   WINBASEAPI DWORD WINAPI FormatMessageW (DWORD dwFlags, LPCVOID
lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD
nSize, va_list *Arguments);
      |
                                              ~~~~~~~^~~~~~~~
../qga/vss-win32.c: In function 'vss_init':
../qga/vss-win32.c:90:23: error: passing argument 5 of 'FormatMessageW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
   90 |                       (char *)&msg, 0, NULL);
      |                       ^~~~~~~~~~~~
      |                       |
      |                       char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/vss-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1366:122:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
 1366 |   WINBASEAPI DWORD WINAPI FormatMessageW (DWORD dwFlags, LPCVOID
lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD
nSize, va_list *Arguments);
      |
                                              ~~~~~~~^~~~~~~~
In file included from C:/work/xemu/qemu/qga/vss-win32.h:16,
                 from ../qga/main.c:39:
../qga/main.c: In function 'quit_handler':
C:/work/xemu/qemu/qga/vss-win32/vss-handles.h:12:28: error: passing
argument 3 of 'OpenEventW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   12 | #define EVENT_NAME_TIMEOUT "Global\\QGAVSSEvent-timeout"
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            |
      |                            const char *
../qga/main.c:160:60: note: in expansion of macro 'EVENT_NAME_TIMEOUT'
  160 |         hEventTimeout = OpenEvent(EVENT_ALL_ACCESS, FALSE,
EVENT_NAME_TIMEOUT);
      |
 ^~~~~~~~~~~~~~~~~~
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:35,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/main.c:14:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/synchapi.h:55:95:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   55 |   WINBASEAPI HANDLE WINAPI OpenEventW (DWORD dwDesiredAccess,
WINBOOL bInheritHandle, LPCWSTR lpName);
      |
                  ~~~~~~~~^~~~~~
In file included from ../qga/main.c:38:
../qga/main.c: In function 'service_main':
C:/work/xemu/qemu/qga/service-win32.h:20:34: error: passing argument 1 of
'RegisterServiceCtrlHandlerExW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   20 | #define QGA_SERVICE_NAME         "qemu-ga"
      |                                  ^~~~~~~~~
      |                                  |
      |                                  const char *
../qga/main.c:719:59: note: in expansion of macro 'QGA_SERVICE_NAME'
  719 |     service->status_handle =
RegisterServiceCtrlHandlerEx(QGA_SERVICE_NAME,
      |
^~~~~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/main.c:14:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:319:80:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  319 |   WINADVAPI SERVICE_STATUS_HANDLE WINAPI
RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName,LPHANDLER_FUNCTION_EX
lpHandlerProc,LPVOID lpContext);
      |
   ~~~~~~~~^~~~~~~~~~~~~
../qga/main.c: In function 'main':
../qga/main.c:1542:15: error: initialization of 'WCHAR *' {aka 'short
unsigned int *'} from incompatible pointer type 'char *'
[-Werror=incompatible-pointer-types]
 1542 |             { (char *)QGA_SERVICE_NAME, service_main }, { NULL,
NULL } };
      |               ^
../qga/main.c:1542:15: note: (near initialization for
'service_table[0].lpServiceName')
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:1430:qga/qemu-ga.exe.p/vss-win32.c.obj] 错误 1 (已忽略)
make: [Makefile.ninja:1427:qga/qemu-ga.exe.p/channel-win32.c.obj] 错误 1 (已忽略)
make: [Makefile.ninja:896:libblock.fa.p/block_file-win32.c.obj] 错误 1 (已忽略)
Linking static target chardev/libchardev.fa
C:\CI-Tools\msys64\mingw64\bin\ar.exe:
chardev/libchardev.fa.p/char-win.c.obj: No such file or directory
make: [Makefile.ninja:780:chardev/libchardev.fa] 错误 1 (已忽略)
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:1429:qga/qemu-ga.exe.p/main.c.obj] 错误 1 (已忽略)
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:882:libblock.fa.p/block.c.obj] 错误 1 (已忽略)
../util/oslib-win32.c: In function 'qemu_get_local_state_pathname':
../util/oslib-win32.c:289:58: error: passing argument 5 of
'SHGetFolderPathW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  289 |                              /* SHGFP_TYPE_CURRENT */ 0, base_path);
      |                                                          ^~~~~~~~~
      |                                                          |
      |                                                          char *
In file included from ../util/oslib-win32.c:44:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/shlobj.h:39:92: note:
expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of type
'char *'
   39 |   SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE
hToken, DWORD dwFlags, LPWSTR pszPath);
      |
                ~~~~~~~^~~~~~~
../util/oslib-win32.c: In function 'qemu_init_exec_dir':
../util/oslib-win32.c:327:35: error: passing argument 2 of
'GetModuleFileNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  327 |     len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);
      |                                   ^~~
      |                                   |
      |                                   char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../util/oslib-win32.c:33:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:153:71:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  153 |   WINBASEAPI DWORD WINAPI GetModuleFileNameW (HMODULE hModule,
LPWSTR lpFilename, DWORD nSize);
      |
 ~~~~~~~^~~~~~~~~~
../util/oslib-win32.c: In function 'qemu_write_pidfile':
../util/oslib-win32.c:801:23: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  801 |     file = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ,
NULL,
      |                       ^~~~~~~~
      |                       |
      |                       const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../util/oslib-win32.c:33:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../qga/commands-win32.c: In function 'acquire_privilege':
../qga/commands-win32.c:285:41: error: passing argument 2 of
'LookupPrivilegeValueW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  285 |         if (!LookupPrivilegeValue(NULL, name,
&priv.Privileges[0].Luid)) {
      |                                         ^~~~
      |                                         |
      |                                         const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:2519:81:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
 2519 |   WINADVAPI WINBOOL WINAPI LookupPrivilegeValueW (LPCWSTR
lpSystemName, LPCWSTR lpName, PLUID lpLuid);
      |
    ~~~~~~~~^~~~~~
../qga/commands-win32.c: In function 'qmp_guest_shutdown':
../qga/commands-win32.c:343:23: error: passing argument 1 of
'acquire_privilege' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  343 |     acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
      |                       ^~~~~~~~~~~~~~~~
      |                       |
      |                       const short unsigned int *
../qga/commands-win32.c:276:43: note: expected 'const char *' but argument
is of type 'const short unsigned int *'
  276 | static void acquire_privilege(const char *name, Error **errp)
      |                               ~~~~~~~~~~~~^~~~
../qga/commands-win32.c: In function 'get_pci_info':
../qga/commands-win32.c:600:48: error: passing argument 3 of
'SetupDiGetDeviceInstanceIdW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  600 |                                                parent_dev_id, size,
&size)) {
      |                                                ^~~~~~~~~~~~~
      |                                                |
      |                                                char *
In file included from ../qga/commands-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/setupapi.h:1562:119:
note: expected 'PWSTR' {aka 'short unsigned int *'} but argument is of type
'char *'
 1562 |   WINSETUPAPI WINBOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO
DeviceInfoSet,PSP_DEVINFO_DATA DeviceInfoData,PWSTR DeviceInstanceId,DWORD
DeviceInstanceIdSize,PDWORD RequiredSize);
      |
                                            ~~~~~~^~~~~~~~~~~~~~~~
../qga/commands-win32.c:615:47: error: passing argument 2 of
'CM_Locate_DevNodeW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  615 |             cr = CM_Locate_DevInst(&dev_inst, parent_dev_id, 0);
      |                                               ^~~~~~~~~~~~~
      |                                               |
      |                                               char *
In file included from ../qga/commands-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:887:77:
note: expected 'DEVINSTID_W' {aka 'short unsigned int *'} but argument is
of type 'char *'
  887 |   CMAPI CONFIGRET WINAPI CM_Locate_DevNodeW(PDEVINST
pdnDevInst,DEVINSTID_W pDeviceID,ULONG ulFlags);
      |
~~~~~~~~~~~~^~~~~~~~~
../qga/commands-win32.c:644:52: error: passing argument 2 of
'CM_Get_Device_IDW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  644 |             cr = CM_Get_Device_ID(parent_dev_inst, parent_dev_id,
dev_id_size,
      |                                                    ^~~~~~~~~~~~~
      |                                                    |
      |                                                    char *
In file included from ../qga/commands-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:811:69:
note: expected 'PWCHAR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  811 |   CMAPI CONFIGRET WINAPI CM_Get_Device_IDW(DEVINST dnDevInst,PWCHAR
Buffer,ULONG BufferLen,ULONG ulFlags);
      |
 ~~~~~~~^~~~~~
../qga/commands-win32.c:657:65: error: passing argument 2 of
'SetupDiGetClassDevsW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  657 |             SetupDiGetClassDevs(&GUID_DEVINTERFACE_STORAGEPORT,
parent_dev_id,
      |
^~~~~~~~~~~~~
      |                                                                 |
      |
char *
In file included from ../qga/commands-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/setupapi.h:1637:81:
note: expected 'PCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
 1637 |   WINSETUPAPI HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID
*ClassGuid,PCWSTR Enumerator,HWND hwndParent,DWORD Flags);
      |
     ~~~~~~~^~~~~~~~~~
../qga/commands-win32.c: In function 'get_single_disk_info':
../qga/commands-win32.c:822:29: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  822 |     disk_h = CreateFile(disk->dev, 0, FILE_SHARE_READ, NULL,
OPEN_EXISTING,
      |                         ~~~~^~~~~
      |                             |
      |                             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../qga/commands-win32.c: In function 'build_guest_disk_info':
../qga/commands-win32.c:891:24: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  891 |     vol_h = CreateFile(name, 0, FILE_SHARE_READ, NULL,
OPEN_EXISTING,
      |                        ^~~~
      |                        |
      |                        char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../qga/commands-win32.c: In function 'build_guest_fsinfo':
../qga/commands-win32.c:1003:37: error: passing argument 1 of
'GetVolumePathNamesForVolumeNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1003 |     GetVolumePathNamesForVolumeName(guid, (LPCH)&mnt, 0,
&info_size);
      |                                     ^~~~
      |                                     |
      |                                     char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:71:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW
(LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength,
PDWORD lpcchReturnLength);
      |
~~~~~~~~^~~~~~~~~~~~~~
../qga/commands-win32.c:1003:43: error: passing argument 2 of
'GetVolumePathNamesForVolumeNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1003 |     GetVolumePathNamesForVolumeName(guid, (LPCH)&mnt, 0,
&info_size);
      |                                           ^~~~~~~~~~
      |                                           |
      |                                           CHAR * {aka char *}
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:93:
note: expected 'LPWCH' {aka 'short unsigned int *'} but argument is of type
'CHAR *' {aka 'char *'}
   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW
(LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength,
PDWORD lpcchReturnLength);
      |
                  ~~~~~~^~~~~~~~~~~~~~~~~~~
../qga/commands-win32.c:1010:42: error: passing argument 1 of
'GetVolumePathNamesForVolumeNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1010 |     if (!GetVolumePathNamesForVolumeName(guid, mnt_point, info_size,
      |                                          ^~~~
      |                                          |
      |                                          char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:71:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW
(LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength,
PDWORD lpcchReturnLength);
      |
~~~~~~~~^~~~~~~~~~~~~~
../qga/commands-win32.c:1010:48: error: passing argument 2 of
'GetVolumePathNamesForVolumeNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1010 |     if (!GetVolumePathNamesForVolumeName(guid, mnt_point, info_size,
      |                                                ^~~~~~~~~
      |                                                |
      |                                                char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:93:
note: expected 'LPWCH' {aka 'short unsigned int *'} but argument is of type
'char *'
   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW
(LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength,
PDWORD lpcchReturnLength);
      |
                  ~~~~~~^~~~~~~~~~~~~~~~~~~
../qga/commands-win32.c:1016:35: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
 1016 |     hLocalDiskHandle = CreateFile(guid, 0 , 0, NULL, OPEN_EXISTING,
      |                                   ^~~~
      |                                   |
      |                                   char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../qga/commands-win32.c:1045:34: error: passing argument 1 of
'GetDiskFreeSpaceExW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1045 |         if (GetDiskFreeSpaceEx(fs->mountpoint,
      |                                ~~^~~~~~~~~~~~
      |                                  |
      |                                  char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:174:58:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  174 |   WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceExW (LPCWSTR
lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller,
PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER
lpTotalNumberOfFreeBytes);
      |
 ~~~~~~~~^~~~~~~~~~~~~~~
../qga/commands-win32.c: In function 'qmp_guest_get_fsinfo':
../qga/commands-win32.c:1070:29: error: passing argument 1 of
'FindFirstVolumeW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1070 |     vol_h = FindFirstVolume(guid, sizeof(guid));
      |                             ^~~~
      |                             |
      |                             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:58:53:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
   58 |   WINBASEAPI HANDLE WINAPI FindFirstVolumeW (LPWSTR lpszVolumeName,
DWORD cchBufferLength);
      |                                              ~~~~~~~^~~~~~~~~~~~~~
../qga/commands-win32.c:1089:36: error: passing argument 2 of
'FindNextVolumeW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1089 |     } while (FindNextVolume(vol_h, guid, sizeof(guid)));
      |                                    ^~~~
      |                                    |
      |                                    char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:60:73:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
   60 |   WINBASEAPI WINBOOL WINAPI FindNextVolumeW (HANDLE hFindVolume,
LPWSTR lpszVolumeName, DWORD cchBufferLength);
      |
 ~~~~~~~^~~~~~~~~~~~~~
../qga/commands-win32.c: In function 'qmp_guest_suspend_disk':
../qga/commands-win32.c:1372:23: error: passing argument 1 of
'acquire_privilege' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1372 |     acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
      |                       ^~~~~~~~~~~~~~~~
      |                       |
      |                       const short unsigned int *
../qga/commands-win32.c:276:43: note: expected 'const char *' but argument
is of type 'const short unsigned int *'
  276 | static void acquire_privilege(const char *name, Error **errp)
      |                               ~~~~~~~~~~~~^~~~
../qga/commands-win32.c: In function 'qmp_guest_suspend_ram':
../qga/commands-win32.c:1395:23: error: passing argument 1 of
'acquire_privilege' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1395 |     acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
      |                       ^~~~~~~~~~~~~~~~
      |                       |
      |                       const short unsigned int *
../qga/commands-win32.c:276:43: note: expected 'const char *' but argument
is of type 'const short unsigned int *'
  276 | static void acquire_privilege(const char *name, Error **errp)
      |                               ~~~~~~~~~~~~^~~~
../qga/commands-win32.c: In function 'guest_addr_to_str':
../qga/commands-win32.c:1459:34: error: passing argument 4 of
'WSAAddressToStringW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1459 |                                  addr_str,
      |                                  ^~~~~~~~
      |                                  |
      |                                  char *
In file included from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:1086:141:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
 1086 |   WINSOCK_API_LINKAGE INT WSAAPI WSAAddressToStringW(LPSOCKADDR
lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPWSTR
lpszAddressString,LPDWORD lpdwAddressStringLength);
      |

 ~~~~~~~^~~~~~~~~~~~~~~~~
../qga/commands-win32.c: In function 'guest_get_network_stats':
../qga/commands-win32.c:1509:42: error: passing argument 1 of
'GetModuleHandleW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1509 |         HMODULE module = GetModuleHandle("iphlpapi");
      |                                          ^~~~~~~~~~
      |                                          |
      |                                          const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:140:53:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  140 | WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);
      |                                             ~~~~~~~~^~~~~~~~~~~~
../qga/commands-win32.c: In function 'qmp_guest_set_time':
../qga/commands-win32.c:1686:24: error: passing argument 1 of 'strerror_s'
from incompatible pointer type [-Werror=incompatible-pointer-types]
 1686 |             strerror_s((LPTSTR) & msg_buffer, 0, errno);
      |                        ^~~~~~~~~~~~~~~~~~~~~
      |                        |
      |                        WCHAR * {aka short unsigned int *}
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/string.h:190,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:87,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h:26:44:
note: expected 'char *' but argument is of type 'WCHAR *' {aka 'short
unsigned int *'}
   26 |   _SECIMP errno_t __cdecl strerror_s(char *_Buf,size_t
_SizeInBytes,int _ErrNum);
      |                                      ~~~~~~^~~~
In file included from ../qga/commands-win32.c:39:
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 6 has type 'const WCHAR *' {aka
'const short unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../qga/commands-win32.c:1687:13: note: in expansion of macro 'error_setg'
 1687 |             error_setg(errp, "system(...) failed: %s",
(LPCTSTR)msg_buffer);
      |             ^~~~~~~~~~
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 7 has type 'const WCHAR *' {aka
'const short unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../qga/commands-win32.c:1702:21: note: in expansion of macro 'error_setg'
 1702 |                     error_setg(errp, "w32tm failed with error
(0x%lx): %s", hr,
      |                     ^~~~~~~~~~
cc1.exe: all warnings being treated as errors
../qga/commands-win32.c:1731:23: error: passing argument 1 of
'acquire_privilege' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1731 |     acquire_privilege(SE_SYSTEMTIME_NAME, &local_err);
      |                       ^~~~~~~~~~~~~~~~~~
      |                       |
      |                       const short unsigned int *
../qga/commands-win32.c:276:43: note: expected 'const char *' but argument
is of type 'const short unsigned int *'
  276 | static void acquire_privilege(const char *name, Error **errp)
      |                               ~~~~~~~~~~~~^~~~
../qga/commands-win32.c: In function 'ga_get_win_version':
../qga/commands-win32.c:2119:38: error: passing argument 1 of
'GetModuleHandleW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 2119 |     HMODULE module = GetModuleHandle("ntdll");
      |                                      ^~~~~~~
      |                                      |
      |                                      const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:140:53:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  140 | WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);
      |                                             ~~~~~~~~^~~~~~~~~~~~
make: [Makefile.ninja:648:libqemuutil.a.p/util_oslib-win32.c.obj] 错误 1 (已忽略)
Linking static target libqemuutil.a

make[1]: 离开目录“/c/work/xemu/qemu/capstone”
"C:/CI-Tools/msys64/mingw64/bin/python3.exe"
"C:/work/xemu/qemu/meson/meson.py" "--internal" "exe" "--capture"
"qemu-version.h" "--" "sh" "C:/work/xemu/qemu/scripts/qemu-version.sh"
"C:/work/xemu/qemu" "" "5.1.50" && if test -e qemu-version.h; then printf
'%s\n' qemu-version.h > qemu-version.h.stamp; fi
"cc" "-Ilibqemuutil.a.p" "-I." "-I.." "-Iqapi" "-Itrace" "-Iui"
"-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include"
"-IC:/CI-Tools/msys64/mingw64/include/glib-2.0"
"-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include"
"-IC:/CI-Tools/msys64/mingw64/include/p11-kit-1" "-fdiagnostics-color=auto"
"-pipe" "-Wall" "-Winvalid-pch" "-Werror" "-std=gnu99" "-g" "-m64" "-mcx16"
"-DUNICODE" "-D_UNICODE" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64"
"-D_LARGEFILE_SOURCE" "-Wstrict-prototypes" "-Wredundant-decls" "-Wundef"
"-Wwrite-strings" "-Wmissing-prototypes" "-fno-strict-aliasing"
"-fno-common" "-fwrapv" "-Wold-style-declaration" "-Wold-style-definition"
"-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self"
"-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels"
"-Wexpansion-to-defined" "-Wno-missing-include-dirs"
"-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong"
"-iquote" "/c/work/xemu/qemu/tcg/i386" "-iquote" "." "-iquote"
"/c/work/xemu/qemu" "-iquote" "/c/work/xemu/qemu/accel/tcg" "-iquote"
"/c/work/xemu/qemu/include" "-iquote" "/c/work/xemu/qemu/disas/libvixl"
"-pthread" "-mms-bitfields" "-mms-bitfields" -MD -MQ
libqemuutil.a.p/util_oslib-win32.c.obj -MF
"libqemuutil.a.p/util_oslib-win32.c.obj.d" -o
libqemuutil.a.p/util_oslib-win32.c.obj "-c" ../util/oslib-win32.c -MP
../util/oslib-win32.c: In function 'qemu_get_local_state_pathname':
../util/oslib-win32.c:289:58: error: passing argument 5 of
'SHGetFolderPathW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  289 |                              /* SHGFP_TYPE_CURRENT */ 0, base_path);
      |                                                          ^~~~~~~~~
      |                                                          |
      |                                                          char *
In file included from ../util/oslib-win32.c:44:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/shlobj.h:39:92: note:
expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of type
'char *'
   39 |   SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE
hToken, DWORD dwFlags, LPWSTR pszPath);
      |
                ~~~~~~~^~~~~~~
../util/oslib-win32.c: In function 'qemu_init_exec_dir':
../util/oslib-win32.c:327:35: error: passing argument 2 of
'GetModuleFileNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  327 |     len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);
      |                                   ^~~
      |                                   |
      |                                   char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../util/oslib-win32.c:33:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:153:71:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  153 |   WINBASEAPI DWORD WINAPI GetModuleFileNameW (HMODULE hModule,
LPWSTR lpFilename, DWORD nSize);
      |
 ~~~~~~~^~~~~~~~~~
../util/oslib-win32.c: In function 'qemu_write_pidfile':
../util/oslib-win32.c:801:23: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  801 |     file = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ,
NULL,
      |                       ^~~~~~~~
      |                       |
      |                       const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../util/oslib-win32.c:33:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
cc1.exe: all warnings being treated as errors
make: *** [Makefile.ninja:648:libqemuutil.a.p/util_oslib-win32.c.obj] 错误 1
```



>
> -- >8 --
> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> index 412962d91a2..cd5cedc0b21 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -74,6 +74,12 @@ extern int daemon(int, int);
>  /* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
*/
>  #ifdef __MINGW32__
>  #define __USE_MINGW_ANSI_STDIO 1
> +#ifndef UNICODE
> +#define UNICODE
> +#endif
> +#ifndef _UNICODE
> +#define _UNICODE
> +#endif
>  #endif
>
>  #include <stdarg.h>
> ---
>
> >    vhost_user="no"
> >    audio_possible_drivers="dsound sdl"
> >    if check_include dsound.h; then
> >
>


--
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo
Re: [PATCH] guest agent: Fixes for windows guest agent building on msys2/mingw
Posted by Philippe Mathieu-Daudé 3 years, 7 months ago
On 9/15/20 7:41 PM, 罗勇刚(Yonggang Luo) wrote:
> On Wed, Sep 16, 2020 at 12:41 AM Philippe Mathieu-Daudé
> <philmd@redhat.com <mailto:philmd@redhat.com>> wrote:
>>
>> On 9/15/20 6:33 PM, Yonggang Luo wrote:
>> > error message:
>> > "cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi"
> "-Itrace" "-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include"
> "-IC:/CI-Tools/msys64/mingw64/include/glib-2.0"
> "-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include"
> "-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror"
> "-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE"
> "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-Wstrict-prototypes"
> "-Wredundant-decls" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes"
> "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wold-style-declaration"
> "-Wold-style-definition" "-Wtype-limits" "-Wformat-security"
> "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body"
> "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined"
> "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi"
> "-fstack-protector-strong" "-iquote" "/c/work/xemu/qemu/tcg/i386"
> "-iquote" "." "-iquote" "/c/work/xemu/qemu" "-iquote"
> "/c/work/xemu/qemu/accel/tcg" "-iquote" "/c/work/xemu/qemu/include"
> "-iquote" "/c/work/xemu/qemu/disas/libvixl" "-pthread" "-mms-bitfields"
> -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF
> "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o
> qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP
>> > ../qga/commands-win32.c:62:24: error: redundant redeclaration of
> 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
>> >    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
>> >       |                        ^~~~~~~~~~~~~~~~~~~~~~~~
>> > In file included from ../qga/commands-win32.c:26:
>> >
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26:
> note: previous declaration of 'CM_Get_DevNode_PropertyW' was here
>> >   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST
> dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType,
> PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
>> >       |                          ^~~~~~~~~~~~~~~~~~~~~~~~
>> > cc1.exe: all warnings being treated as errors
>> > make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj]
> 错误 1 (已忽略)
>> >
>> > This error comes from qemu configure didn't add predefined macro
> -DUNICODE -D_UNICODE in QEMU_CFLAGS,
>> > and these too macro are standard config for win32 if using windows
> wide api.
>> >
>> > in cfgmgr32.h
>> >   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,
> const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE
> PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
>> > #ifdef UNICODE
>> > #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW
>> > #endif
>> >
>> > macro CM_Get_DevNode_Property defined only when UNICODE are defined.
>> > and in win32, UNICODE and _UNICODE should be defined at the same time
>> >
>> > #endif
>> >
>> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com
> <mailto:luoyonggang@gmail.com>>
>> > ---
>> >  configure | 1 +
>> >  1 file changed, 1 insertion(+)
>> >
>> > diff --git a/configure b/configure
>> > index 9f141891ea..f5d661af4a 100755
>> > --- a/configure
>> > +++ b/configure
>> > @@ -812,6 +812,7 @@ MINGW32*)
>> >    mingw32="yes"
>> >    hax="yes"
>> >    whpx=""
>> > +  QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS"
>>
>> What about declaring them in include/qemu/osdep.h
>> instead?
> That's a good idea.
> But more compiling error warns me that the windows version of qemu are
> not in a good situation.

:)

> On Win32, all API should call the wide version so that support for
> Unicode properly.
> But obviously the currently qemu didn't do that
> 
> ```
[...]
> ../util/qemu-sockets.c: In function 'socket_sockaddr_to_address_inet':
> C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s'
> expects argument of type 'char *', but argument 6 has type 'WCHAR *'
> {aka 'short unsigned int *'} [-Werror=format=]
>   319 |                         (fmt), ## __VA_ARGS__)
>       |                         ^~~~~
> ../util/qemu-sockets.c:1235:9: note: in expansion of macro 'error_setg'
>  1235 |         error_setg(errp, "Cannot format numeric socket address: %s",
>       |         ^~~~~~~~~~
> In file included from ../io/dns-resolver.c:26:
> ../io/dns-resolver.c: In function 'qio_dns_resolver_lookup_sync_inet':
> C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s'
> expects argument of type 'char *', but argument 8 has type 'WCHAR *'
> {aka 'short unsigned int *'} [-Werror=format=]
>   319 |                         (fmt), ## __VA_ARGS__)
>       |                         ^~~~~
> ../io/dns-resolver.c:93:9: note: in expansion of macro 'error_setg'
>    93 |         error_setg(errp, "address resolution failed for %s:%s: %s",
>       |         ^~~~~~~~~~
> cc1.exe: all warnings being treated as errors
> make: [Makefile.ninja:756:io/libio.fa.p/dns-resolver.c.obj] 错误 1 (已
> 忽略)
> cc1.exe: all warnings being treated as errors
> make: [Makefile.ninja:697:libqemuutil.a.p/util_qemu-sockets.c.obj] 错误
> 1 (已忽略)
> Linking static target io/libio.fa
> C:\CI-Tools\msys64\mingw64\bin\ar.exe: io/libio.fa.p/dns-resolver.c.obj:
> No such file or directory
> make: [Makefile.ninja:764:io/libio.fa] 错误 1 (已忽略)
> ../net/tap-win32.c: In function 'is_tap_win32_dev':
> ../net/tap-win32.c:62:21: error: passing argument 2 of 'RegOpenKeyExW'
> from incompatible pointer type [-Werror=incompatible-pointer-types]
>    62 | #define ADAPTER_KEY
> "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
>       |                    
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                     |
>       |                     const char *
> ../net/tap-win32.c:62:21: note: in definition of macro 'ADAPTER_KEY'
>    62 | #define ADAPTER_KEY
> "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
>       |                    
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
>                  from
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
>                  from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
>                  from C:/work/xemu/qemu/include/qemu/osdep.h:119,
>                  from ../net/tap-win32.c:29:
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
> note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument
> is of type 'const char *'
>   195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
> lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
>       |                                                 ~~~~~~~~^~~~~~~~
> ../net/tap-win32.c:229:13: error: passing argument 3 of 'RegEnumKeyExW'
> from incompatible pointer type [-Werror=incompatible-pointer-types]
>   229 |             enum_name,
>       |             ^~~~~~~~~
>       |             |
>       |             char *
> In file included from
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
>                  from
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
>                  from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
>                  from C:/work/xemu/qemu/include/qemu/osdep.h:119,
>                  from ../net/tap-win32.c:29:
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70:
> note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
> type 'char *'
>   184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD
> dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR
> lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
>       |                                                              
> ~~~~~~~^~~~~~
> ../net/tap-win32.c:247:13: error: passing argument 2 of 'RegOpenKeyExW'
> from incompatible pointer type [-Werror=incompatible-pointer-types]
>   247 |             unit_string,
>       |             ^~~~~~~~~~~
>       |             |
>       |             char *

I'm not sure fixing all these warnings would produce a
maintainable code base. I'd rather disable these 2 warning
classes on Windows.

Re: [PATCH] guest agent: Fixes for windows guest agent building on msys2/mingw
Posted by 罗勇刚 (Yonggang Luo) 3 years, 7 months ago
On Wed, Sep 16, 2020 at 1:55 AM Philippe Mathieu-Daudé <f4bug@amsat.org>
wrote:
>
> On 9/15/20 7:41 PM, 罗勇刚(Yonggang Luo) wrote:
> > On Wed, Sep 16, 2020 at 12:41 AM Philippe Mathieu-Daudé
> > <philmd@redhat.com <mailto:philmd@redhat.com>> wrote:
> >>
> >> On 9/15/20 6:33 PM, Yonggang Luo wrote:
> >> > error message:
> >> > "cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi"
> > "-Itrace" "-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include"
> > "-IC:/CI-Tools/msys64/mingw64/include/glib-2.0"
> > "-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include"
> > "-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror"
> > "-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE"
> > "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-Wstrict-prototypes"
> > "-Wredundant-decls" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes"
> > "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wold-style-declaration"
> > "-Wold-style-definition" "-Wtype-limits" "-Wformat-security"
> > "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body"
> > "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined"
> > "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi"
> > "-fstack-protector-strong" "-iquote" "/c/work/xemu/qemu/tcg/i386"
> > "-iquote" "." "-iquote" "/c/work/xemu/qemu" "-iquote"
> > "/c/work/xemu/qemu/accel/tcg" "-iquote" "/c/work/xemu/qemu/include"
> > "-iquote" "/c/work/xemu/qemu/disas/libvixl" "-pthread" "-mms-bitfields"
> > -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF
> > "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o
> > qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP
> >> > ../qga/commands-win32.c:62:24: error: redundant redeclaration of
> > 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
> >> >    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
> >> >       |                        ^~~~~~~~~~~~~~~~~~~~~~~~
> >> > In file included from ../qga/commands-win32.c:26:
> >> >
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26:
> > note: previous declaration of 'CM_Get_DevNode_PropertyW' was here
> >> >   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST
> > dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType,
> > PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
> >> >       |                          ^~~~~~~~~~~~~~~~~~~~~~~~
> >> > cc1.exe: all warnings being treated as errors
> >> > make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj]
> > 错误 1 (已忽略)
> >> >
> >> > This error comes from qemu configure didn't add predefined macro
> > -DUNICODE -D_UNICODE in QEMU_CFLAGS,
> >> > and these too macro are standard config for win32 if using windows
> > wide api.
> >> >
> >> > in cfgmgr32.h
> >> >   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,
> > const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE
> > PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
> >> > #ifdef UNICODE
> >> > #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW
> >> > #endif
> >> >
> >> > macro CM_Get_DevNode_Property defined only when UNICODE are defined.
> >> > and in win32, UNICODE and _UNICODE should be defined at the same time
> >> >
> >> > #endif
> >> >
> >> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com
> > <mailto:luoyonggang@gmail.com>>
> >> > ---
> >> >  configure | 1 +
> >> >  1 file changed, 1 insertion(+)
> >> >
> >> > diff --git a/configure b/configure
> >> > index 9f141891ea..f5d661af4a 100755
> >> > --- a/configure
> >> > +++ b/configure
> >> > @@ -812,6 +812,7 @@ MINGW32*)
> >> >    mingw32="yes"
> >> >    hax="yes"
> >> >    whpx=""
> >> > +  QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS"
> >>
> >> What about declaring them in include/qemu/osdep.h
> >> instead?
> > That's a good idea.
> > But more compiling error warns me that the windows version of qemu are
> > not in a good situation.
>
> :)
>
> > On Win32, all API should call the wide version so that support for
> > Unicode properly.
> > But obviously the currently qemu didn't do that
> >
> > ```
> [...]
> > ../util/qemu-sockets.c: In function 'socket_sockaddr_to_address_inet':
> > C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s'
> > expects argument of type 'char *', but argument 6 has type 'WCHAR *'
> > {aka 'short unsigned int *'} [-Werror=format=]
> >   319 |                         (fmt), ## __VA_ARGS__)
> >       |                         ^~~~~
> > ../util/qemu-sockets.c:1235:9: note: in expansion of macro 'error_setg'
> >  1235 |         error_setg(errp, "Cannot format numeric socket address:
%s",
> >       |         ^~~~~~~~~~
> > In file included from ../io/dns-resolver.c:26:
> > ../io/dns-resolver.c: In function 'qio_dns_resolver_lookup_sync_inet':
> > C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s'
> > expects argument of type 'char *', but argument 8 has type 'WCHAR *'
> > {aka 'short unsigned int *'} [-Werror=format=]
> >   319 |                         (fmt), ## __VA_ARGS__)
> >       |                         ^~~~~
> > ../io/dns-resolver.c:93:9: note: in expansion of macro 'error_setg'
> >    93 |         error_setg(errp, "address resolution failed for %s:%s:
%s",
> >       |         ^~~~~~~~~~
> > cc1.exe: all warnings being treated as errors
> > make: [Makefile.ninja:756:io/libio.fa.p/dns-resolver.c.obj] 错误 1 (已
> > 忽略)
> > cc1.exe: all warnings being treated as errors
> > make: [Makefile.ninja:697:libqemuutil.a.p/util_qemu-sockets.c.obj] 错误
> > 1 (已忽略)
> > Linking static target io/libio.fa
> > C:\CI-Tools\msys64\mingw64\bin\ar.exe: io/libio.fa.p/dns-resolver.c.obj:
> > No such file or directory
> > make: [Makefile.ninja:764:io/libio.fa] 错误 1 (已忽略)
> > ../net/tap-win32.c: In function 'is_tap_win32_dev':
> > ../net/tap-win32.c:62:21: error: passing argument 2 of 'RegOpenKeyExW'
> > from incompatible pointer type [-Werror=incompatible-pointer-types]
> >    62 | #define ADAPTER_KEY
> >
"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
> >       |
> >
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >       |                     |
> >       |                     const char *
> > ../net/tap-win32.c:62:21: note: in definition of macro 'ADAPTER_KEY'
> >    62 | #define ADAPTER_KEY
> >
"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
> >       |
> >
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
> >                  from
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
> >                  from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
> >                  from C:/work/xemu/qemu/include/qemu/osdep.h:119,
> >                  from ../net/tap-win32.c:29:
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
> > note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument
> > is of type 'const char *'
> >   195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
> > lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
> >       |                                                 ~~~~~~~~^~~~~~~~
> > ../net/tap-win32.c:229:13: error: passing argument 3 of 'RegEnumKeyExW'
> > from incompatible pointer type [-Werror=incompatible-pointer-types]
> >   229 |             enum_name,
> >       |             ^~~~~~~~~
> >       |             |
> >       |             char *
> > In file included from
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
> >                  from
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
> >                  from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
> >                  from C:/work/xemu/qemu/include/qemu/osdep.h:119,
> >                  from ../net/tap-win32.c:29:
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70:
> > note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
> > type 'char *'
> >   184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD
> > dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR
> > lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
> >       |
> > ~~~~~~~^~~~~~
> > ../net/tap-win32.c:247:13: error: passing argument 2 of 'RegOpenKeyExW'
> > from incompatible pointer type [-Werror=incompatible-pointer-types]
> >   247 |             unit_string,
> >       |             ^~~~~~~~~~~
> >       |             |
> >       |             char *
>
> I'm not sure fixing all these warnings would produce a
> maintainable code base. I'd rather disable these 2 warning
> classes on Windows.
I agree with that, seems QEMU currently are calling ANSI api all the time,
better not change that,
 so globally define -DUNICODE -D_UNICODE is not a option


--
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo
Re: [PATCH] guest agent: Fixes for windows guest agent building on msys2/mingw
Posted by Thomas Huth 3 years, 7 months ago
On 15/09/2020 21.17, 罗勇刚(Yonggang Luo) wrote:

> I agree with that, seems QEMU currently are calling ANSI api all the
> time, better not change that,
>  so globally define -DUNICODE -D_UNICODE is not a option

I agree, -DUNICODE is currently not an option. I'll go with my patch
("qga/commands-win32: Fix problem with redundant protype declaration")
for the time being, until someone found a nicer solution that works.

 Thomas