[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 02/11] Add vhost-user-input-pci
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH v6 02/11] Add vhost-user-input-pci |
Date: |
Fri, 26 Apr 2019 11:28:41 +0200 |
Hi
On Fri, Apr 26, 2019 at 9:12 AM Gerd Hoffmann <address@hidden> wrote:
>
> > +static void vhost_input_get_config(VirtIODevice *vdev, uint8_t
> > *config_data)
> > +{
> > + VirtIOInput *vinput = VIRTIO_INPUT(vdev);
> > + VHostUserInput *vhi = VHOST_USER_INPUT(vdev);
> > + int ret;
> > +
> > + memset(config_data, 0, vinput->cfg_size);
> > +
> > + ret = vhost_dev_get_config(&vhi->vhost->dev, config_data,
> > vinput->cfg_size);
> > + if (ret) {
> > + error_report("vhost-user-input: get device config space failed");
> > + return;
> > + }
> > +}
> > +
> > +static void vhost_input_set_config(VirtIODevice *vdev,
> > + const uint8_t *config_data)
> > +{
> > + VHostUserInput *vhi = VHOST_USER_INPUT(vdev);
> > + int ret;
> > +
> > + ret = vhost_dev_set_config(&vhi->vhost->dev, config_data,
> > + 0, sizeof(virtio_input_config),
> > + VHOST_SET_CONFIG_TYPE_MASTER);
> > + if (ret) {
> > + error_report("vhost-user-input: set device config space failed");
> > + return;
> > + }
> > +
> > + virtio_notify_config(vdev);
> > +}
>
> These two look rather generic, the only virtio-input specific thing is
> the config space size. Can we store the size somewhere, then move the
> functions to common vhost-user code?
vhost-user-input is simple, vhost-user-gpu is fiddling with the config
on qemu side.
virtio-input set_config() calls virtio_notify_config(), while
virtio-gpu does not (vhost-user versions copy that).
There isn't much code to share at this point.
--
Marc-André Lureau
- [Qemu-devel] [PATCH v6 00/11] vhost-user for input & GPU, Marc-André Lureau, 2019/04/23
- [Qemu-devel] [PATCH v6 01/11] Add vhost-user-backend, Marc-André Lureau, 2019/04/23
- [Qemu-devel] [PATCH v6 02/11] Add vhost-user-input-pci, Marc-André Lureau, 2019/04/23
- [Qemu-devel] [PATCH v6 03/11] libvhost-user: add PROTOCOL_F_CONFIG if {set, get}_config, Marc-André Lureau, 2019/04/23
- [Qemu-devel] [PATCH v6 04/11] contrib: add vhost-user-input, Marc-André Lureau, 2019/04/23
- [Qemu-devel] [PATCH v6 07/11] util: compile drm.o on Linux, Marc-André Lureau, 2019/04/23
- [Qemu-devel] [PATCH v6 06/11] virtio: add virtio-gpu bswap helpers header, Marc-André Lureau, 2019/04/23
- [Qemu-devel] [PATCH v6 05/11] vhost-user: add vhost_user_gpu_set_socket(), Marc-André Lureau, 2019/04/23