On Wed, Sep 30, 2020 at 03:24:08PM +0100, Stefan Hajnoczi wrote: > On Tue, Sep 29, 2020 at 09:21:54AM -0700, John G Johnson wrote: > > > On Sep 29, 2020, at 3:37 AM, Stefan Hajnoczi <[email protected]> wrote: > > > > > > On Mon, Sep 28, 2020 at 09:58:37AM +0000, Thanos Makatos wrote: > > >>> It should be accompanied by a test in tests/. PCI-level testing APIS for > > >>> BARs, configuration space, interrupts, etc are available in > > >>> tests/qtest/libqos/pci.h. The test case needs to include a vfio-user > > >>> device backend interact with QEMU's vfio-user-pci implementation. > > >> > > >> We plan to use a libmuser-based backend for testing. This, I suppose, > > >> will > > >> make libmuser a dependency of QEMU (either as a submodule or as a > > >> library), > > >> which for now can be disabled in the default configuration. Is this > > >> acceptable? > > > > > > If there are no other dependencies and libmuser supports all host > > > operating systems that QEMU's -device vfio-user supports, then I think > > > it's a good idea to use libmuser for at least one in-tree test in QEMU. > > > > > >>> Also please let us know who is working on what so additional people can > > >>> get involved in areas that need work! > > >> > > >> Swapnil and I will be working on libmuser and the test in QEMU, John and > > >> the mp-qemu folks will be working on the patches for implementing > > >> --device vfio-user-pci. > > > > > > Great! > > > > > > John: Will mpqemu use libmuser to implement the remote PCI host > > > controller? > > > > > > > > > The vfio-user-pci plan is to use libmuser on the server side. > > Okay. Using libmuser in tests seems like a good choice in that case. > > We'll need to figure out the details of how to do it because the > traditional shared library dependency approach is not well-suited to > in-development code. It would involve shipping libmuser distro packages > so QEMU's build system can declare a library dependency (with details > provided in a pkg-config file). > > Here are approaches that are better for in-development libraries: > 1. Keep the libmuser code in qemu.git. > 2. A copy of libmuser in qemu.git with changes being sent upstream > (allows more flexibility in case QEMU-specific issues require > experimentation). > 3. Git submodules. > > #1 if you're happy to use the QEMU development process for merging > libmuser code then it's easiest to officially host the code in qemu.git. > libmuser gets a subdirectory in the qemu.git tree and you (the > maintainers) send pull requests. A libmuser library build target > provides installable static and shared libraries so external > applications can link against libmuser too. The big advantage here is > that QEMU can instantly use the latest libmuser code changes. > > #2 works best if the library is a small (just a few source files) with > no fancy build system requirements. > > #3 is used in QEMU for several other components. Submodules are a pain > to sync (requires sending a qemu.git patch to move to a new commit ID), > so this isn't good for a dependency that moves quickly.
I don't think this is actually downside. If anything I think submodules I think it would actually let libmuser develop faster. QEMU is such a large project with high volume patches, that changes take a long time to merge, even when everything is working well. I think libmuser would have much faster development velocity if the bit flowing into qemu.git was only as the trivial submodule hash updates, as opposed to every single libmuser functional patch. Maintaining libmuser as a standalone git repo avoids need for libmuser to tie itself to QEMU's release cycle or processes. In particular it means libmuser could opt to use a modern development workflow using a GitForge with merge requests, instead of the legacy email workflow. Especially if we're considering libmuser to be consumed by non-QEMU codebases, then long term it almost certainly should be a standalone project. With this in mind, I think it will be better for libmuser to start off as a standalone project straight away, so it can build up its developer community organically, and not have people put off contributing by the QEMU firehose. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
