[Virtio-fs] [PATCH] virtiofsd: add support to change log level on fly

Stefan Hajnoczi stefanha at redhat.com
Thu Aug 22 13:55:04 UTC 2019


On Thu, Aug 22, 2019 at 01:07:18PM +0800, piaojun wrote:
> On 2019/8/21 23:04, Dr. David Alan Gilbert wrote:
> > * Eryu Guan (eguan at linux.alibaba.com) wrote:
> >> Introduce a file which contains the target log level, and
> >> current_log_level will be reloaded to the target log level on SIGHUP.
> >>
> >> The file is set to "/run/virtiofsd/log_level.<pid>". Due to
> >> sandboxing in virtiofsd, this file can only be read/write via
> >> /proc/<pid>/fd/<fd> for now.
> >>
> >> Example usage:
> >>
> >>   # view current log level
> >>   cat /proc/<pid>/fd/<fd>
> >>   # change log level to debug
> >>   echo debug > /proc/<pid>/fd/<fd>
> >>   kill -HUP <pid>
> >>
> >> Signed-off-by: Eryu Guan <eguan at linux.alibaba.com>
> > 
> > This looks really complex for something that can only be used for
> > changing log levels.
> 
> I have the same opinion with Dave, and I wonder if we have some easier
> channel to tell virtiofsd to change log level. And making the channel
> more generic is good for the expansibility of virtiofsd.

There is code for QMP (a JSON RPC-style protocol) in the QEMU codebase
that can be reused.

An option that is more widely used but I have little experience with is
DBus.  It is easy to access from most programming languages, including
the command-line.

Although both of these approaches are somewhat heavyweight, they scale
to much more complex management commands and already have existing
tooling available.

I think we should choose one instead of inventing another RPC system.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virtio-fs/attachments/20190822/56311c7f/attachment.sig>


More information about the Virtio-fs mailing list