qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

util/osdep: Improve error report by calling error_setg_win32()

Use error_setg_win32() which adds a hint similar to strerror(errno)).

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200228100726.8414-3-philmd@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>

authored by

Philippe Mathieu-Daudé and committed by
Markus Armbruster
cf0c76cd 4c235193

+2 -2
+2 -2
util/osdep.c
··· 82 82 DWORD old_protect; 83 83 84 84 if (!VirtualProtect(addr, size, prot, &old_protect)) { 85 - error_report("%s: VirtualProtect failed with error code %ld", 86 - __func__, GetLastError()); 85 + g_autofree gchar *emsg = g_win32_error_message(GetLastError()); 86 + error_report("%s: VirtualProtect failed: %s", __func__, emsg); 87 87 return -1; 88 88 } 89 89 return 0;