diff options
author | Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com> | 2022-09-26 17:03:27 +0300 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-03 15:18:54 +0300 |
commit | 2b09c69cc896841c7828408083f6cb443fef8612 (patch) | |
tree | 0fc020fb6059654d5e0f74acc4cf6c4336889ceb /vhost_user_rng.c | |
parent | 346f9c0f4a72945795b2bf203d2294ff00f25148 (diff) |
Virtio-loopback-adapter Alpha release update:
- Format code style and remove unnecessary comments
Signed-off-by: Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>
Diffstat (limited to 'vhost_user_rng.c')
-rw-r--r-- | vhost_user_rng.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/vhost_user_rng.c b/vhost_user_rng.c index 7dc7d99..f674ef6 100644 --- a/vhost_user_rng.c +++ b/vhost_user_rng.c @@ -1,5 +1,5 @@ /* - * Based on vhost-user-rng of Qemu project + * Based on vhost-user-rng of QEMU project * * Copyright (c) 2021 Mathieu Poirier <mathieu.poirier@linaro.org> * @@ -131,9 +131,9 @@ static void vu_rng_set_status(VirtIODevice *vdev, uint8_t status) } } -static void virtio_dev_class_init (VirtIODevice *vdev) { - - vdev->vdev_class = (VirtioDeviceClass *) malloc(sizeof(VirtioDeviceClass)); +static void virtio_dev_class_init(VirtIODevice *vdev) +{ + vdev->vdev_class = (VirtioDeviceClass *)malloc(sizeof(VirtioDeviceClass)); vdev->vdev_class->parent = vdev; vdev->vdev_class->set_status = vu_rng_set_status; vdev->vdev_class->get_features = vu_rng_get_features; @@ -142,16 +142,16 @@ static void virtio_dev_class_init (VirtIODevice *vdev) { } -void vhost_user_rng_init(VirtIODevice *vdev) { - - VHostUserRNG *vhrng = (VHostUserRNG*) malloc (sizeof(VHostUserRNG)); +void vhost_user_rng_init(VirtIODevice *vdev) +{ + VHostUserRNG *vhrng = (VHostUserRNG *)malloc(sizeof(VHostUserRNG)); vdev->vhrng = vhrng; vhrng->parent = vdev; vhrng->req_vq = vdev->vq; vhrng->vhost_dev = dev; - virtio_dev_class_init (vdev); - virtio_mmio_bus_init(vdev->vbus); + virtio_dev_class_init(vdev); + virtio_loopback_bus_init(vdev->vbus); } static void vu_rng_handle_output(VirtIODevice *vdev, VirtQueue *vq) @@ -175,14 +175,15 @@ void vhost_user_rng_realize(void) global_vdev->host_features = 0x39000000; - proxy = (VirtIOMMIOProxy*) malloc (sizeof(VirtIOMMIOProxy)); + proxy = (VirtIOMMIOProxy *)malloc(sizeof(VirtIOMMIOProxy)); *proxy = (VirtIOMMIOProxy) { .legacy = 1, }; /* Virtqueues conf */ dev->nvqs = 1; - dev->vqs = (struct vhost_virtqueue*) malloc(dev->nvqs * sizeof(struct vhost_virtqueue)); + dev->vqs = (struct vhost_virtqueue *)malloc(dev->nvqs * + sizeof(struct vhost_virtqueue)); vhost_dev_init(dev); } |