summary refs log tree commit diff stats
path: root/include/hw/virtio/vhost-user-i2c.h
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2024-01-04 21:09:39 +0000
committerMichael S. Tsirkin <mst@redhat.com>2024-02-14 06:01:49 -0500
commita50616b50d0107c3bbdf9fae5ac1f3659dfc70f3 (patch)
tree5ccb972233fe51438eca0aa507b0c900719f58c2 /include/hw/virtio/vhost-user-i2c.h
parent5ba587580db55bd310dc64d0eb89b4f7b19c6404 (diff)
downloadfocaccia-qemu-a50616b50d0107c3bbdf9fae5ac1f3659dfc70f3.tar.gz
focaccia-qemu-a50616b50d0107c3bbdf9fae5ac1f3659dfc70f3.zip
hw/virtio: derive vhost-user-i2c from vhost-user-base
Now we can take advantage of the new base class and make
vhost-user-i2c a much simpler boilerplate wrapper. Also as this
doesn't require any target specific hacks we only need to build the
stubs once.

Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240104210945.1223134-6-alex.bennee@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/virtio/vhost-user-i2c.h')
-rw-r--r--include/hw/virtio/vhost-user-i2c.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/include/hw/virtio/vhost-user-i2c.h b/include/hw/virtio/vhost-user-i2c.h
index 0f7acd40e3..a9b5612ad0 100644
--- a/include/hw/virtio/vhost-user-i2c.h
+++ b/include/hw/virtio/vhost-user-i2c.h
@@ -9,23 +9,17 @@
 #ifndef QEMU_VHOST_USER_I2C_H
 #define QEMU_VHOST_USER_I2C_H
 
+#include "hw/virtio/virtio.h"
 #include "hw/virtio/vhost.h"
 #include "hw/virtio/vhost-user.h"
+#include "hw/virtio/vhost-user-base.h"
 
 #define TYPE_VHOST_USER_I2C "vhost-user-i2c-device"
+
 OBJECT_DECLARE_SIMPLE_TYPE(VHostUserI2C, VHOST_USER_I2C)
 
 struct VHostUserI2C {
-    VirtIODevice parent;
-    CharBackend chardev;
-    struct vhost_virtqueue *vhost_vq;
-    struct vhost_dev vhost_dev;
-    VhostUserState vhost_user;
-    VirtQueue *vq;
-    bool connected;
+    VHostUserBase parent_obj;
 };
 
-/* Virtio Feature bits */
-#define VIRTIO_I2C_F_ZERO_LENGTH_REQUEST		0
-
 #endif /* QEMU_VHOST_USER_I2C_H */