From e6d6621bced8b62dc9f98a09870b527535cbb158 Mon Sep 17 00:00:00 2001 From: Timos Ampelikiotis Date: Fri, 25 Nov 2022 13:39:49 +0100 Subject: 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 --- vhost_user_rng.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vhost_user_rng.c') 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); } -- cgit 1.2.3-korg