summaryrefslogtreecommitdiffstats
path: root/vhost_user_input.c
diff options
context:
space:
mode:
authorTimos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>2022-11-25 13:39:49 +0100
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-03 15:18:54 +0300
commite6d6621bced8b62dc9f98a09870b527535cbb158 (patch)
treea0779840e12602ad199e4ee45a7976e89e39b129 /vhost_user_input.c
parenta3fcee5911bf760f9f4522e94cb9e6ab22a7eb95 (diff)
Virtio-loopback-adapter Beta version:
- Build a single virtio-loopback-adapter binary - Mmap the vrings with dynamic defined size - Add set_mem_table mechanism (Not used into this release) Signed-off-by: Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>
Diffstat (limited to 'vhost_user_input.c')
-rw-r--r--vhost_user_input.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vhost_user_input.c b/vhost_user_input.c
index cf3fb2e..cd5cb4f 100644
--- a/vhost_user_input.c
+++ b/vhost_user_input.c
@@ -106,6 +106,7 @@ static void vhost_input_class_init(VirtIODevice *vdev)
vdev->vhuinput->vdev_input->input_class->realize = vhost_user_input_realize;
vdev->vhuinput->vdev_input->input_class->change_active =
vhost_input_change_active;
+ vdev->vdev_class->update_mem_table = update_mem_table;
}
@@ -123,6 +124,7 @@ void vhost_user_input_init(VirtIODevice *vdev)
vdev->vinput->input_class = input_class;
vdev->vhuinput = vhuinput;
+ vdev->nvqs = &dev->nvqs;
vhuinput->vdev = vdev;
vhuinput->vhost_dev = dev;
vhuinput->vdev_input = vinput;
@@ -158,6 +160,9 @@ void vhost_user_input_realize()
global_vdev->vhuinput->vhost_dev->num_queues = nvqs;
+ global_vdev->vq = (struct VirtQueue *)malloc(
+ sizeof(struct VirtQueue) * nvqs);
+
global_vdev->vhuinput->vhost_dev->nvqs = nvqs;
global_vdev->vhuinput->vhost_dev->vqs = (struct vhost_virtqueue *)malloc(
sizeof(struct vhost_virtqueue) * nvqs);