mbox series

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

Message ID 20221129173809.544174-1-andrey.drobyshev@virtuozzo.com (mailing list archive)
Headers show
Series qga: improve "syslog" domain logging | expand

Message

Andrey Drobyshev Nov. 29, 2022, 5:38 p.m. UTC
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

Comments

Andrey Drobyshev Dec. 12, 2022, 12:18 p.m. UTC | #1
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?
Konstantin Kostiuk Dec. 12, 2022, 12:29 p.m. UTC | #2
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?
>
>
Konstantin Kostiuk Dec. 16, 2022, 10:01 a.m. UTC | #3
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?
>>
>>
Andrey Drobyshev Dec. 16, 2022, 3:28 p.m. UTC | #4
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.
Konstantin Kostiuk Dec. 16, 2022, 3:36 p.m. UTC | #5
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.
>
>