qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Felipe Franciosi <felipe@nutanix.com>
Cc: "benjamin.walker@intel.com" <benjamin.walker@intel.com>,
	John G Johnson <john.g.johnson@oracle.com>,
	"jag.raman@oracle.com" <jag.raman@oracle.com>,
	Swapnil Ingle <swapnil.ingle@nutanix.com>,
	"james.r.harris@intel.com" <james.r.harris@intel.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"yuvalkashtan@gmail.com" <yuvalkashtan@gmail.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"elena.ufimtseva@oracle.com" <elena.ufimtseva@oracle.com>,
	Raphael Norwitz <raphael.norwitz@nutanix.com>,
	"marcandre.lureau@redhat.com" <marcandre.lureau@redhat.com>,
	"ismael@linux.com" <ismael@linux.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	Thanos Makatos <thanos.makatos@nutanix.com>,
	"xiuchun.lu@intel.com" <xiuchun.lu@intel.com>,
	"tomassetti.andrea@gmail.com" <tomassetti.andrea@gmail.com>,
	"changpeng.liu@intel.com" <changpeng.liu@intel.com>,
	"tina.zhang@intel.com" <tina.zhang@intel.com>,
	"Kanth.Ghatraju@oracle.com" <Kanth.Ghatraju@oracle.com>,
	"dgilbert@redhat.com" <dgilbert@redhat.com>
Subject: Re: [PATCH v4] introduce vfio-user protocol specification
Date: Tue, 13 Oct 2020 10:30:56 +0100	[thread overview]
Message-ID: <20201013093056.GA164611@stefanha-x1.localdomain> (raw)
In-Reply-To: <E0C4979F-157D-4ADC-9FCF-23A70FB6C931@nutanix.com>

[-- Attachment #1: Type: text/plain, Size: 5675 bytes --]

On Fri, Oct 02, 2020 at 10:14:23AM +0000, Felipe Franciosi wrote:
> 
> 
> > On Sep 30, 2020, at 3:24 PM, Stefan Hajnoczi <stefanha@redhat.com> 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 <stefanha@redhat.com> 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.
> 
> I think there's a couple of limitations here which we should keep in mind.
> 
> 1. Does putting it in qemu.git precludes it being BSD-3?
> There's been evidence of people using (or at least trying out) muser
> from where it currently lives. That doesn't mean we can't move it, but
> I'm wondering if it means we have to make it GPL.

The 3-clause BSD license is compatible with the GPL according to
Wikipedia:
https://en.wikipedia.org/wiki/BSD_licenses

> 2. What about other projects that need libmuser code?
> What worries me more is projects like SPDK/DPDK wanting to link
> against the library and having to clone the entire QEMU repo as a
> submodule. That sounds a lot more expensive than option 3 and probably
> have further complications if they aren't GPL.

In the early stages where the vfio-user protocol and library interfaces
might need changes it will be hard to use it from multiple applications
without compatibility issues. If SPDK/DPDK are communicating with QEMU
using a cutting-edge library then they probably need to build QEMU from
source anyway. ISTR they also maintain a QEMU fork? So maybe it's not a
big issue for them.

> > 
> > #2 works best if the library is a small (just a few source files) with
> > no fancy build system requirements.
> 
> The risk here is that they go out of sync. There's the same (or even
> more) maintenance burden as point 3 below, with the added risk that
> someone could patch the files and make cherry-picks non-trivial.
> 
> > 
> > #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 argue this is no worse than option 2. It's what I think aligns best,
> but let's keep weighing pros/cons and come to a conclusion together.
> The list of maintainers for muser.git should be extended to include
> more QEMU stakeholders and probably other projects that will use it
> (as) heavily. The topic has been raised in SPDK's Slack team on
> whether the client library should live in a repo of its own (eg.
> libvfio-user.git). Given the reference implementation is in libmuser,
> I still think muser.git is accurate (but can easily be persuaded
> otherwise).

Me too, no solution is perfect. My thoughts about developing it within
qemu.git for now is that this will make protocol and library interface
changes easy. It will also encourage applications (DPDK/SPDK) to build
against a matching QEMU so that there are no compatibility problems at
the protocol or library level while the code is still heavily under
development.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-10-13  9:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 11:20 [PATCH v3] introduce VFIO-over-socket protocol specificaion Thanos Makatos
2020-07-21 16:33 ` Nikos Dragazis
2020-07-22 11:43   ` Thanos Makatos
2020-09-15 14:29 ` [PATCH v4] introduce vfio-user protocol specification Thanos Makatos
2020-09-24  8:21   ` Stefan Hajnoczi
2020-09-24  9:24     ` Michael S. Tsirkin
2020-09-28  9:58     ` Thanos Makatos
2020-09-29 10:37       ` Stefan Hajnoczi
2020-09-29 16:21         ` John G Johnson
2020-09-30 14:24           ` Stefan Hajnoczi
2020-10-02 10:14             ` Felipe Franciosi
2020-10-13  9:30               ` Stefan Hajnoczi [this message]
2020-10-15 13:36                 ` Felipe Franciosi
2020-10-30 19:14                   ` Stefan Hajnoczi
2020-10-13  9:42             ` Daniel P. Berrangé
2020-09-29 10:41   ` Stefan Hajnoczi
2020-10-28 16:10 ` [PATCH v5] " Thanos Makatos
2020-10-28 16:41   ` Thanos Makatos
2020-10-30 17:03     ` John Levon
2020-11-02 11:29       ` Thanos Makatos
2020-11-02 11:41         ` John Levon
2020-11-02 11:51           ` Thanos Makatos
2020-11-06  1:50             ` John G Johnson
2020-11-07 12:26               ` John Levon
2020-11-09 12:07                 ` Thanos Makatos
2020-11-09  9:20         ` Thanos Makatos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201013093056.GA164611@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=Kanth.Ghatraju@oracle.com \
    --cc=alex.williamson@redhat.com \
    --cc=benjamin.walker@intel.com \
    --cc=changpeng.liu@intel.com \
    --cc=dgilbert@redhat.com \
    --cc=elena.ufimtseva@oracle.com \
    --cc=felipe@nutanix.com \
    --cc=ismael@linux.com \
    --cc=jag.raman@oracle.com \
    --cc=james.r.harris@intel.com \
    --cc=john.g.johnson@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael.norwitz@nutanix.com \
    --cc=swapnil.ingle@nutanix.com \
    --cc=thanos.makatos@nutanix.com \
    --cc=tina.zhang@intel.com \
    --cc=tomassetti.andrea@gmail.com \
    --cc=xiuchun.lu@intel.com \
    --cc=yuvalkashtan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).