diff options
author | Andrey Drobyshev <andrey.drobyshev@virtuozzo.com> | 2022-11-29 19:38:08 +0200 |
---|---|---|
committer | Konstantin Kostiuk <kkostiuk@redhat.com> | 2022-12-20 15:54:41 +0200 |
commit | f9f0e6173e1d570847930abfe2b4560c7b6a964a (patch) | |
tree | 3c7de9b4dd51618ddcbc1c2325411806e6a1a219 /qga/installer | |
parent | 28236ad8d152ffb8e7e7a280747df50cd8e49471 (diff) | |
download | qemu-f9f0e6173e1d570847930abfe2b4560c7b6a964a.zip qemu-f9f0e6173e1d570847930abfe2b4560c7b6a964a.tar.gz qemu-f9f0e6173e1d570847930abfe2b4560c7b6a964a.tar.bz2 |
qga-win: add logging to Windows event log
This commit allows QGA to write to Windows event log using Win32 API's
ReportEvent() [1], much like syslog() under *nix guests.
In order to generate log message definitions we use a very basic message
text file [2], so that every QGA's message gets ID 1. The tools
"windmc" and "windres" respectively are used to generate ".rc" file and
COFF object file, and then the COFF file is linked into qemu-ga.exe.
[1] https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-reporteventa
[2] https://learn.microsoft.com/en-us/windows/win32/eventlog/message-text-files
Originally-by: Yuri Pudgorodskiy <yur@virtuozzo.com>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Tested-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Diffstat (limited to 'qga/installer')
-rw-r--r-- | qga/installer/qemu-ga.wxs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs index 813d1c6..e344c38 100644 --- a/qga/installer/qemu-ga.wxs +++ b/qga/installer/qemu-ga.wxs @@ -110,6 +110,11 @@ <RegistryValue Type="string" Name="ProductID" Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" /> <RegistryValue Type="string" Name="Version" Value="$(var.QEMU_GA_VERSION)" /> </RegistryKey> + <RegistryKey Root="HKLM" + Key="System\CurrentControlSet\Services\EventLog\Application\qemu-ga"> + <RegistryValue Type="integer" Name="TypesSupported" Value="7" /> + <RegistryValue Type="string" Name="EventMessageFile" Value="[qemu_ga_directory]qemu-ga.exe" /> + </RegistryKey> </Component> </Directory> </Directory> |