[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: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH v6 02/11] Add vhost-user-input-pci |
Date: |
Fri, 26 Apr 2019 09:11:52 +0200 |
User-agent: |
NeoMutt/20180716 |
> +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?
cheers,
Gerd
- [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
- Re: [Qemu-devel] [PATCH v6 02/11] Add vhost-user-input-pci,
Gerd Hoffmann <=
- [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