summaryrefslogtreecommitdiffstats
path: root/vhost_user_rng.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_rng.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_rng.c')
-rw-r--r--vhost_user_rng.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vhost_user_rng.c b/vhost_user_rng.c
index f674ef6..860c33e 100644
--- a/vhost_user_rng.c
+++ b/vhost_user_rng.c
@@ -139,6 +139,7 @@ static void virtio_dev_class_init(VirtIODevice *vdev)
vdev->vdev_class->get_features = vu_rng_get_features;
vdev->vdev_class->guest_notifier_mask = vu_rng_guest_notifier_mask;
vdev->vdev_class->guest_notifier_pending = vu_rng_guest_notifier_pending;
+ vdev->vdev_class->update_mem_table = update_mem_table;
}
@@ -146,6 +147,7 @@ void vhost_user_rng_init(VirtIODevice *vdev)
{
VHostUserRNG *vhrng = (VHostUserRNG *)malloc(sizeof(VHostUserRNG));
vdev->vhrng = vhrng;
+ vdev->nvqs = &dev->nvqs;
vhrng->parent = vdev;
vhrng->req_vq = vdev->vq;
vhrng->vhost_dev = dev;
@@ -166,6 +168,7 @@ static void vu_rng_handle_output(VirtIODevice *vdev, VirtQueue *vq)
void vhost_user_rng_realize(void)
{
+ /* Initiliaze virtio_dev data structures */
virtio_dev_init(global_vdev, "virtio-rng", 4, 0);
/* This needs to be change to vhost-user-rng init */
@@ -185,5 +188,6 @@ void vhost_user_rng_realize(void)
dev->vqs = (struct vhost_virtqueue *)malloc(dev->nvqs *
sizeof(struct vhost_virtqueue));
+ /* Initiale vhost-user communication */
vhost_dev_init(dev);
}