[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 09/12] Add vhost-input-pci
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [RFC v2 09/12] Add vhost-input-pci |
Date: |
Mon, 4 Jun 2018 10:58:30 +0200 |
User-agent: |
NeoMutt/20180512 |
> +#define TYPE_VHOST_USER_INPUT_PCI "vhost-user-input-pci"
Patch $subject mismatch.
> +struct VHostUserInput {
> + VirtIOInput parent_obj;
> +
> + VhostUserBackend *vhost;
> +};
Nothing input specific here ...
> +static void vhost_input_change_active(VirtIOInput *vinput)
> +{
> + VHostUserInput *vhi = VHOST_USER_INPUT(vinput);
> +
> + if (!vhi->vhost) {
> + return;
> + }
> +
> + if (vinput->active) {
> + vhost_user_backend_start(vhi->vhost);
> + } else {
> + vhost_user_backend_stop(vhi->vhost);
> + }
> +}
... and here ...
> +static const VMStateDescription vmstate_vhost_input = {
> + .name = "vhost-user-input",
> + .unmigratable = 1,
> +};
... and here ...
> +static void vhost_input_is_busy(const Object *obj, const char *name,
> + Object *val, Error **errp)
> +{
> + VHostUserInput *vhi = VHOST_USER_INPUT(obj);
> +
> + if (vhi->vhost) {
> + error_setg(errp, "can't use already busy vhost-user");
> + } else {
> + qdev_prop_allow_set_link_before_realize(obj, name, val, errp);
> + }
> +}
... likewise ...
So, maybe it makes sense to have a abstact base class for vhost-user
devices? And possibly move the vhost-backend code to the base class
then?
cheers,
Gerd
- Re: [Qemu-devel] [RFC v2 06/12] vhost-user: add vhost_user_input_get_config(), (continued)
[Qemu-devel] [RFC v2 07/12] libvhost-user: export vug_source_new, Marc-André Lureau, 2018/06/01
[Qemu-devel] [RFC v2 05/12] vhost-user: split vhost_user_read(), Marc-André Lureau, 2018/06/01
[Qemu-devel] [RFC v2 08/12] contrib: add vhost-user-input, Marc-André Lureau, 2018/06/01
[Qemu-devel] [RFC v2 09/12] Add vhost-input-pci, Marc-André Lureau, 2018/06/01
- Re: [Qemu-devel] [RFC v2 09/12] Add vhost-input-pci,
Gerd Hoffmann <=
[Qemu-devel] [RFC v2 10/12] vhost-user: add vhost_user_gpu_set_socket(), Marc-André Lureau, 2018/06/01
[Qemu-devel] [RFC v2 11/12] Add virtio-gpu vhost-user backend, Marc-André Lureau, 2018/06/01
[Qemu-devel] [RFC v2 12/12] contrib: add vhost-user-gpu, Marc-André Lureau, 2018/06/01