All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Christian Speich <c.speich@avm.de>
Cc: qemu-devel@nongnu.org, "Stefano Garzarella" <sgarzare@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH] virtio: vhost-user-device: Make user creatable again
Date: Thu, 25 Sep 2025 05:33:12 -0400	[thread overview]
Message-ID: <20250925053005-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <qvq5owxu7teejoejhoelvauiknbhd5el6qlwj3ud4bi5f7ydya@vsojjbotm44w>

On Thu, Sep 25, 2025 at 09:56:02AM +0200, Christian Speich wrote:
> On Mon, Sep 22, 2025 at 10:37:40AM -0400, Michael S. Tsirkin wrote:
> > On Mon, Sep 22, 2025 at 01:11:33PM +0200, Christian Speich wrote:
> > > On Mon, Sep 22, 2025 at 06:56:31AM -0400, Michael S. Tsirkin wrote:
> > > > On Mon, Sep 22, 2025 at 12:40:33PM +0200, Christian Speich wrote:
> > > > > On Fri, Sep 19, 2025 at 04:07:19PM -0400, Michael S. Tsirkin wrote:
> > > > > > On Fri, Sep 19, 2025 at 04:30:53PM +0200, Christian Speich wrote:
> > > > > > > This removes the change introduced in [1] that prevents the use of
> > > > > > > vhost-user-device and vhost-user-device-pci on unpatched QEMU builds.
> > > > > > > 
> > > > > > > [1]: 6275989647efb708f126eb4f880e593792301ed4
> > > > > > > 
> > > > > > > Signed-off-by: Christian Speich <c.speich@avm.de>
> > > > > > > ---
> > > > > > > vhost-user-device and vhost-user-device-pci started out as user
> > > > > > > creatable devices. This was changed in [1] when the vhost-user-base was
> > > > > > > introduced.
> > > > > > > 
> > > > > > > The reason given is to prevent user confusion. Searching qemu-discuss or
> > > > > > > google for "vhost-user-device" I've seen no confused users.
> > > > > > > 
> > > > > > > Our use case is to provide wifi emulation using "vhost-user-device-pci",
> > > > > > > which currently is working fine with the QEMU 9.0.2 present in Ubuntu
> > > > > > > 24.04. With newer QEMU versions we now need to patch, distribute and
> > > > > > > maintain our own QEMU packages, which is non-trivial.
> > > > > > > 
> > > > > > > So I want to propose lifting this restriction to make this feature
> > > > > > > usable without a custom QEMU.
> > > > > > > 
> > > > > > > [1]: 6275989647efb708f126eb4f880e593792301ed4
> > > > > > 
> > > > > > The confusion is after someone reuses the ID you are claiming without
> > > > > > telling anyone and then linux guests will start binding that driver to
> > > > > > your device.
> > > > > 
> > > > > Thanks for clarifciation, In our use-case we use mac80211_hwsim which is
> > > > > in linux upstream (with the ID 29). So I think a potential reuse here
> > > > > is something that linux upstream already deals with.
> > > > 
> > > > So just allow that one?
> > > 
> > > That would solve our problem.
> > > 
> > > However, I'm finding it somwhat odd to artifically force the user only use
> > > QEMU it the "allowed way". I'd much rather see that virtio-user-device is
> > > usuable as is (and mac80211_hwsim is not a special case and just works).
> > > 
> > > Regards,
> > > Christian
> > 
> > We can combine both. Want to try?
> 
> I'm not sure what both means here?
> 
> Greetings,
> Christian

Both add a generic device with a declaration that
it is unsupported and maybe "x-" name prefix, for developers,
and a supported mac80211_hwsim device, for users.


> > 
> > 
> > > > 
> > > > > > 
> > > > > > 
> > > > > > We want people doing this kind of thing to *at a minimum*
> > > > > > go ahead and register a device id with the virtio TC,
> > > > > > but really to write and publish a spec.
> > > > > 
> > > > > I understand this desire, I'm not sure how this relates with the ability
> > > > > to let a user create a vhost-user-device or not.
> > > > > 
> > > > > Kind Regards,
> > > > > Christian
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > > ---
> > > > > > >  docs/system/devices/vhost-user.rst | 10 ----------
> > > > > > >  hw/virtio/vhost-user-device-pci.c  |  3 ---
> > > > > > >  hw/virtio/vhost-user-device.c      |  3 ---
> > > > > > >  3 files changed, 16 deletions(-)
> > > > > > > 
> > > > > > > diff --git a/docs/system/devices/vhost-user.rst b/docs/system/devices/vhost-user.rst
> > > > > > > index 35259d8ec7c666aa0c56497b8261f48d77216ad5..2d130f9767dbb1cbb85cef43c63dc9a8d7b30d4a 100644
> > > > > > > --- a/docs/system/devices/vhost-user.rst
> > > > > > > +++ b/docs/system/devices/vhost-user.rst
> > > > > > > @@ -73,16 +73,6 @@ all the required parameters including:
> > > > > > >    - The ``num_vqs`` it needs and their ``vq_size``
> > > > > > >    - The ``config_size`` if needed
> > > > > > >  
> > > > > > > -.. note::
> > > > > > > -  To prevent user confusion you cannot currently instantiate
> > > > > > > -  vhost-user-device without first patching out::
> > > > > > > -
> > > > > > > -    /* Reason: stop inexperienced users confusing themselves */
> > > > > > > -    dc->user_creatable = false;
> > > > > > > -
> > > > > > > -  in ``vhost-user-device.c`` and ``vhost-user-device-pci.c`` file and
> > > > > > > -  rebuilding.
> > > > > > > -
> > > > > > >  vhost-user daemon
> > > > > > >  =================
> > > > > > >  
> > > > > > > diff --git a/hw/virtio/vhost-user-device-pci.c b/hw/virtio/vhost-user-device-pci.c
> > > > > > > index f10bac874e78429c633752a4ce9db28385b3bb07..c76a856c9b9a67d941a93929244216658ff2a156 100644
> > > > > > > --- a/hw/virtio/vhost-user-device-pci.c
> > > > > > > +++ b/hw/virtio/vhost-user-device-pci.c
> > > > > > > @@ -38,9 +38,6 @@ static void vhost_user_device_pci_class_init(ObjectClass *klass,
> > > > > > >      VirtioPCIClass *k = VIRTIO_PCI_CLASS(klass);
> > > > > > >      PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
> > > > > > >  
> > > > > > > -    /* Reason: stop users confusing themselves */
> > > > > > > -    dc->user_creatable = false;
> > > > > > > -
> > > > > > >      k->realize = vhost_user_device_pci_realize;
> > > > > > >      set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
> > > > > > >      pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
> > > > > > > diff --git a/hw/virtio/vhost-user-device.c b/hw/virtio/vhost-user-device.c
> > > > > > > index 3939bdf755222a281da8ca22243d7d4f16990a66..1bea496afd0137ba9b42009f6252acf6800528d1 100644
> > > > > > > --- a/hw/virtio/vhost-user-device.c
> > > > > > > +++ b/hw/virtio/vhost-user-device.c
> > > > > > > @@ -41,9 +41,6 @@ static void vud_class_init(ObjectClass *klass, const void *data)
> > > > > > >  {
> > > > > > >      DeviceClass *dc = DEVICE_CLASS(klass);
> > > > > > >  
> > > > > > > -    /* Reason: stop inexperienced users confusing themselves */
> > > > > > > -    dc->user_creatable = false;
> > > > > > > -
> > > > > > >      device_class_set_props(dc, vud_properties);
> > > > > > >      dc->vmsd = &vud_vmstate;
> > > > > > >      set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
> > > > > > > 
> > > > > > > ---
> > > > > > > base-commit: e7c1e8043a69c5a8efa39d4f9d111f7c72c076e6
> > > > > > > change-id: 20250919-vhost-user-device-creatable-b7f9b7b5bfb2
> > > > > > > 
> > > > > > > Best regards,
> > > > > > > -- 
> > > > > > > Christian Speich <c.speich@avm.de>
> > > > > > 
> > > > > > 
> > > > 
> > > > 
> > 
> > 



  reply	other threads:[~2025-09-25  9:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 14:30 [PATCH] virtio: vhost-user-device: Make user creatable again Christian Speich
2025-09-19 14:46 ` Stefano Garzarella
2025-09-19 20:07 ` Michael S. Tsirkin
2025-09-22 10:40   ` Christian Speich via
2025-09-22 10:56     ` Michael S. Tsirkin
2025-09-22 11:11       ` Christian Speich via
2025-09-22 14:37         ` Michael S. Tsirkin
2025-09-25  7:56           ` Christian Speich
2025-09-25  9:33             ` Michael S. Tsirkin [this message]
2025-09-25 10:14               ` Christian Speich
2025-09-22 11:33   ` Daniel P. Berrangé
2025-09-22 12:15     ` Michael S. Tsirkin
2025-09-22 12:49       ` Daniel P. Berrangé
2025-09-22 13:08         ` Michael S. Tsirkin
2025-09-22 13:26           ` Christian Speich via
2025-09-22 13:30             ` Michael S. Tsirkin
2025-09-22 13:42               ` Christian Speich
2025-09-22 15:14               ` Alex Bennée
2025-09-29  8:12                 ` Christian Speich
2025-09-29  8:22                 ` Daniel P. Berrangé
2025-09-29  8:24                   ` Michael S. Tsirkin
2025-09-29  9:52                     ` Alex Bennée
2025-09-29 10:07                     ` Daniel P. Berrangé
2025-10-04 17:33                       ` Michael S. Tsirkin
2025-10-09 10:20                         ` Daniel P. Berrangé
2025-10-09 16:49                           ` Alex Bennée
2025-09-22 12:51     ` Alex Bennée
2025-09-22 13:33     ` Christian Speich
2025-09-22 14:38       ` Daniel P. Berrangé

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=20250925053005-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=c.speich@avm.de \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.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 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.