All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/3] virtiofsd: get/set log level via DBus
@ 2019-09-05 15:21 ` Stefan Hajnoczi
  0 siblings, 0 replies; 36+ messages in thread
From: Stefan Hajnoczi @ 2019-09-05 15:21 UTC (permalink / raw)
  To: qemu-devel, virtio-fs
  Cc: Marc-André Lureau, Eryu Guan, Dr. David Alan Gilbert,
	Stefan Hajnoczi

It is likely that virtiofsd will need to support "management commands" for
reconfiguring it at runtime.  The first use case was proposed by Eryu Guan for
getting/setting the current log level.

I promised to try out DBus as the management interface because it has a rich
feature set and is accessible from most programming languages.  It should be
able to support all the use cases we come up with.

This patch series is a prototype that implements the get-log-level and
set-log-level management commands via DBus.  Use the new virtiofsctl tool to
talk to a running virtiofsd process:

  # dbus-run-session ./virtiofsd ...
  ...
  Using dbus address unix:abstract=/tmp/dbus-H9WBbpjk3O,guid=0be16acefb868e6025a8737f5d7124d2
  # export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-H9WBbpjk3O,guid=0be16acefb868e6025a8737f5d7124d2
  # ./virtiofsctl set-log-level err

Most of the work is done by gdbus-codegen(1).  It generates code for the
org.qemu.Virtiofsd.xml interface definition.  Our code can use the simple
virtiofsd_get/set_log_level() APIs and it will make corresponding DBus calls.

I'm pretty happy with this approach because the code is straightforward.  It
hasn't even triggered seccomp failures yet :).

Error handling is a little problematic.  I noticed that virtiofsctl silently
returns success even if it cannot talk to virtiofsd.  This is due to the code
generated by gdbus-codegen(1) which has no error reporting :(.  This can be
solved by writing more low-level GDBus code instead of using the high-level
generated bindings.

What do you think about this approach?

Stefan Hajnoczi (3):
  virtiofsd: add org.qemu.Virtiofsd interface
  virtiofsd: add DBus server to handle log level changes
  virtiofsd: add virtiofsctl command-line management tool

 configure                                |   7 +
 Makefile                                 |  16 +++
 Makefile.objs                            |   1 +
 contrib/virtiofsd/Makefile.objs          |  10 +-
 contrib/virtiofsd/dbus.h                 |   9 ++
 contrib/virtiofsd/dbus.c                 | 162 +++++++++++++++++++++++
 contrib/virtiofsd/passthrough_ll.c       |   8 +-
 contrib/virtiofsd/virtiofsctl.c          |  55 ++++++++
 .gitignore                               |   1 +
 contrib/virtiofsd/org.qemu.Virtiofsd.xml |   7 +
 10 files changed, 274 insertions(+), 2 deletions(-)
 create mode 100644 contrib/virtiofsd/dbus.h
 create mode 100644 contrib/virtiofsd/dbus.c
 create mode 100644 contrib/virtiofsd/virtiofsctl.c
 create mode 100644 contrib/virtiofsd/org.qemu.Virtiofsd.xml

-- 
2.21.0



^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2019-09-09 12:38 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05 15:21 [Qemu-devel] [RFC 0/3] virtiofsd: get/set log level via DBus Stefan Hajnoczi
2019-09-05 15:21 ` [Virtio-fs] " Stefan Hajnoczi
2019-09-05 15:21 ` [Qemu-devel] [RFC 1/3] virtiofsd: add org.qemu.Virtiofsd interface Stefan Hajnoczi
2019-09-05 15:21   ` [Virtio-fs] " Stefan Hajnoczi
2019-09-05 15:21 ` [Qemu-devel] [RFC 2/3] virtiofsd: add DBus server to handle log level changes Stefan Hajnoczi
2019-09-05 15:21   ` [Virtio-fs] " Stefan Hajnoczi
2019-09-05 17:27   ` [Qemu-devel] " Dr. David Alan Gilbert
2019-09-05 17:27     ` [Virtio-fs] " Dr. David Alan Gilbert
2019-09-06 10:23     ` [Qemu-devel] " Stefan Hajnoczi
2019-09-06 10:23       ` [Virtio-fs] " Stefan Hajnoczi
2019-09-06 10:49       ` [Qemu-devel] " Daniel P. Berrangé
2019-09-06 10:49         ` [Virtio-fs] " Daniel P. Berrangé
2019-09-06 11:12         ` Dr. David Alan Gilbert
2019-09-06 11:12           ` [Virtio-fs] " Dr. David Alan Gilbert
2019-09-06 11:48           ` Daniel P. Berrangé
2019-09-06 11:48             ` [Virtio-fs] " Daniel P. Berrangé
2019-09-05 15:21 ` [Qemu-devel] [RFC 3/3] virtiofsd: add virtiofsctl command-line management tool Stefan Hajnoczi
2019-09-05 15:21   ` [Virtio-fs] " Stefan Hajnoczi
2019-09-05 17:12   ` [Qemu-devel] " Dr. David Alan Gilbert
2019-09-05 17:12     ` [Virtio-fs] " Dr. David Alan Gilbert
2019-09-05 20:03     ` [Qemu-devel] " Marc-André Lureau
2019-09-05 20:03       ` [Virtio-fs] " Marc-André Lureau
2019-09-06 10:33       ` [Qemu-devel] " Stefan Hajnoczi
2019-09-06 10:33         ` [Virtio-fs] " Stefan Hajnoczi
2019-09-05 17:40 ` [Qemu-devel] [RFC 0/3] virtiofsd: get/set log level via DBus Dr. David Alan Gilbert
2019-09-05 17:40   ` [Virtio-fs] " Dr. David Alan Gilbert
2019-09-06 10:29   ` [Qemu-devel] " Stefan Hajnoczi
2019-09-06 10:29     ` [Virtio-fs] " Stefan Hajnoczi
2019-09-06 10:35     ` [Qemu-devel] " Dr. David Alan Gilbert
2019-09-06 10:35       ` [Virtio-fs] " Dr. David Alan Gilbert
2019-09-06 11:03     ` [Qemu-devel] " Daniel P. Berrangé
2019-09-06 11:03       ` [Virtio-fs] " Daniel P. Berrangé
2019-09-06 10:47 ` Daniel P. Berrangé
2019-09-06 10:47   ` [Virtio-fs] " Daniel P. Berrangé
2019-09-09 12:37 ` Stefan Hajnoczi
2019-09-09 12:37   ` [Virtio-fs] " Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.