Hi On Mon, Jul 8, 2019 at 8:04 PM Daniel P. Berrangé <berra...@redhat.com> wrote: > > The D-Bus protocol can be made to work peer-to-peer, but the most > > common and practical way is through a bus daemon. This also has the > > advantage of increased debuggability (you can eavesdrop on the bus and > > introspect it). > > The downside of using the bus daemon is that we have to spawn a new > instance of dbus-daemon for every QEMU VM that's running on the host, > which is yet more memory overhead for each VM & another process to > manage, and yet another thing to go wrong.
dbus-daemon (or dbus-broker) has been optimized to fit on many devices and use cases, it doesn't take much memory (3mb for my session dbus right now). More processes to manage is inevitable. In a near future, we may have 5-10 processes running around qemu. I think dbus-daemon will be one of the easiest to deal with. (as can be seen in the dbus-vmstate test, it is very simple to start a private dbus-daemon) > > QEMU already has a direct UNIX socket connection to the helper > processes in question. I'd much rather we just had another direct > UNIX socket connection to that helper, using D-Bus peer-to-peer. > The benefit of debugging doesn't feel compelling enough to justify > running an extra daemon for each VM. I wouldn't minor the need for easier debugging. Debugging multiple processes talking to each other is really hard. Having a bus is awesome (if not required) in this case. There are other advantages of using a bus, those come to my mind: - less connections (bus topology) - configuring/enforcing policies & limits - on-demand service activation & discoverability I also think D-Bus is the IPC of choice for multi-process. It's easier to use than many other IPC due to the various tools and language bindings available. Having a common bus is a good incentive to use a common IPC, instead of a dozen of half-baked protocols. Nevertheless, I also think we could use D-Bus in peer-to-peer mode, and I did some investigation. The slirp-helper supports it. We could teach dbus-vmstate to eastablish peer-to-peer connections. Instead of receiving a bus address and list of Ids, it could have a list of dbus peer socket path. Both approaches are not incompatible, but I think the bus benefits outweigh the downside of running an extra process.