[PATCH v2 0/2] qga: improve "syslog" domain logging

Andrey Drobyshev via posted 2 patches 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221129173809.544174-1-andrey.drobyshev@virtuozzo.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, Konstantin Kostiuk <kkostiuk@redhat.com>, Michael Roth <michael.roth@amd.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
configure                 |  3 +++
qga/installer/qemu-ga.wxs |  5 ++++
qga/main.c                | 50 +++++++++++++++++++++++++++++++++++----
qga/meson.build           | 19 ++++++++++++++-
qga/messages-win32.mc     |  9 +++++++
5 files changed, 81 insertions(+), 5 deletions(-)
create mode 100644 qga/messages-win32.mc
[PATCH v2 0/2] qga: improve "syslog" domain logging
Posted by Andrey Drobyshev via 1 year, 4 months ago
These patches extend QGA logging interface, primarily under Windows
guests.  They enable QGA to write to Windows event log, much like
syslog() on *nix.  In addition we get rid of hardcoded log level used by
ga_log().

v2:
* Close event_log handle when doing cleanup_agent()
* Fix switch cases indentation as reported by scripts/checkpatch.pl

Andrey Drobyshev (2):
  qga-win: add logging to Windows event log
  qga: map GLib log levels to system levels

 configure                 |  3 +++
 qga/installer/qemu-ga.wxs |  5 ++++
 qga/main.c                | 50 +++++++++++++++++++++++++++++++++++----
 qga/meson.build           | 19 ++++++++++++++-
 qga/messages-win32.mc     |  9 +++++++
 5 files changed, 81 insertions(+), 5 deletions(-)
 create mode 100644 qga/messages-win32.mc

-- 
2.38.1
Re: [PATCH v2 0/2] qga: improve "syslog" domain logging
Posted by Andrey Drobyshev 1 year, 3 months ago
On 11/29/22 19:38, Andrey Drobyshev wrote:
> These patches extend QGA logging interface, primarily under Windows
> guests.  They enable QGA to write to Windows event log, much like
> syslog() on *nix.  In addition we get rid of hardcoded log level used by
> ga_log().
> 
> v2:
> * Close event_log handle when doing cleanup_agent()
> * Fix switch cases indentation as reported by scripts/checkpatch.pl
> 
> Andrey Drobyshev (2):
>   qga-win: add logging to Windows event log
>   qga: map GLib log levels to system levels
> 
>  configure                 |  3 +++
>  qga/installer/qemu-ga.wxs |  5 ++++
>  qga/main.c                | 50 +++++++++++++++++++++++++++++++++++----
>  qga/meson.build           | 19 ++++++++++++++-
>  qga/messages-win32.mc     |  9 +++++++
>  5 files changed, 81 insertions(+), 5 deletions(-)
>  create mode 100644 qga/messages-win32.mc
> 

Could you please clarify the status of these patches?
Re: [PATCH v2 0/2] qga: improve "syslog" domain logging
Posted by Konstantin Kostiuk 1 year, 3 months ago
Currently, there is a code freeze in QEMU for release 7.2.
I will merge this after it https://wiki.qemu.org/Planning/7.2

Best Regards,
Konstantin Kostiuk.


On Mon, Dec 12, 2022 at 2:17 PM Andrey Drobyshev <
andrey.drobyshev@virtuozzo.com> wrote:

> On 11/29/22 19:38, Andrey Drobyshev wrote:
> > These patches extend QGA logging interface, primarily under Windows
> > guests.  They enable QGA to write to Windows event log, much like
> > syslog() on *nix.  In addition we get rid of hardcoded log level used by
> > ga_log().
> >
> > v2:
> > * Close event_log handle when doing cleanup_agent()
> > * Fix switch cases indentation as reported by scripts/checkpatch.pl
> >
> > Andrey Drobyshev (2):
> >   qga-win: add logging to Windows event log
> >   qga: map GLib log levels to system levels
> >
> >  configure                 |  3 +++
> >  qga/installer/qemu-ga.wxs |  5 ++++
> >  qga/main.c                | 50 +++++++++++++++++++++++++++++++++++----
> >  qga/meson.build           | 19 ++++++++++++++-
> >  qga/messages-win32.mc     |  9 +++++++
> >  5 files changed, 81 insertions(+), 5 deletions(-)
> >  create mode 100644 qga/messages-win32.mc
> >
>
> Could you please clarify the status of these patches?
>
>
Re: [PATCH v2 0/2] qga: improve "syslog" domain logging
Posted by Konstantin Kostiuk 1 year, 3 months ago
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Tested-by: Konstantin Kostiuk <kkostiuk@redhat.com>


Hi Andrey,
Do you expect Event Viewer to be empty by default in the current
implementation?
Currently, all logs that we write in the guest agent do not have "syslog"
domain
so we will have logs only in file.

On Mon, Dec 12, 2022 at 2:29 PM Konstantin Kostiuk <kkostiuk@redhat.com>
wrote:

> Currently, there is a code freeze in QEMU for release 7.2.
> I will merge this after it https://wiki.qemu.org/Planning/7.2
>
> Best Regards,
> Konstantin Kostiuk.
>
>
> On Mon, Dec 12, 2022 at 2:17 PM Andrey Drobyshev <
> andrey.drobyshev@virtuozzo.com> wrote:
>
>> On 11/29/22 19:38, Andrey Drobyshev wrote:
>> > These patches extend QGA logging interface, primarily under Windows
>> > guests.  They enable QGA to write to Windows event log, much like
>> > syslog() on *nix.  In addition we get rid of hardcoded log level used by
>> > ga_log().
>> >
>> > v2:
>> > * Close event_log handle when doing cleanup_agent()
>> > * Fix switch cases indentation as reported by scripts/checkpatch.pl
>> >
>> > Andrey Drobyshev (2):
>> >   qga-win: add logging to Windows event log
>> >   qga: map GLib log levels to system levels
>> >
>> >  configure                 |  3 +++
>> >  qga/installer/qemu-ga.wxs |  5 ++++
>> >  qga/main.c                | 50 +++++++++++++++++++++++++++++++++++----
>> >  qga/meson.build           | 19 ++++++++++++++-
>> >  qga/messages-win32.mc     |  9 +++++++
>> >  5 files changed, 81 insertions(+), 5 deletions(-)
>> >  create mode 100644 qga/messages-win32.mc
>> >
>>
>> Could you please clarify the status of these patches?
>>
>>
Re: [PATCH v2 0/2] qga: improve "syslog" domain logging
Posted by Andrey Drobyshev 1 year, 3 months ago
On 12/16/22 12:01, Konstantin Kostiuk wrote:
> Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com
> <mailto:kkostiuk@redhat.com>>
> Tested-by: Konstantin Kostiuk <kkostiuk@redhat.com
> <mailto:kkostiuk@redhat.com>>
> 
> 
> Hi Andrey,
> Do you expect Event Viewer to be empty by default in the current
> implementation?
> Currently, all logs that we write in the guest agent do not have
> "syslog" domain
> so we will have logs only in file.
> 
> [...]

Do they not really?  For instance, I see quite a few such calls in the
implementation of guest commands:

# grep 'slog(' qga/commands-win32.c | wc -l
21

They just need to be triggered.  For instance, if I build QGA with these
patches applied, run it in a VM make a fsfreeze call:

# virsh domfsfreeze win2k16-qga-win
Froze 2 filesystem(s)

then I see the message "guest-fsfreeze called" in the event log.
Re: [PATCH v2 0/2] qga: improve "syslog" domain logging
Posted by Konstantin Kostiuk 1 year, 3 months ago
Thanks.

You are right. I tested another command and don't see logs in the event
viewer.

PR was sent.

On Fri, Dec 16, 2022 at 5:27 PM Andrey Drobyshev <
andrey.drobyshev@virtuozzo.com> wrote:

> On 12/16/22 12:01, Konstantin Kostiuk wrote:
> > Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com
> > <mailto:kkostiuk@redhat.com>>
> > Tested-by: Konstantin Kostiuk <kkostiuk@redhat.com
> > <mailto:kkostiuk@redhat.com>>
> >
> >
> > Hi Andrey,
> > Do you expect Event Viewer to be empty by default in the current
> > implementation?
> > Currently, all logs that we write in the guest agent do not have
> > "syslog" domain
> > so we will have logs only in file.
> >
> > [...]
>
> Do they not really?  For instance, I see quite a few such calls in the
> implementation of guest commands:
>
> # grep 'slog(' qga/commands-win32.c | wc -l
> 21
>
> They just need to be triggered.  For instance, if I build QGA with these
> patches applied, run it in a VM make a fsfreeze call:
>
> # virsh domfsfreeze win2k16-qga-win
> Froze 2 filesystem(s)
>
> then I see the message "guest-fsfreeze called" in the event log.
>
>