1 /* 2 * Vhost-user RNG virtio device 3 * 4 * Copyright (c) 2021 Mathieu Poirier <mathieu.poirier@linaro.org> 5 * 6 * SPDX-License-Identifier: GPL-2.0-or-later 7 */ 8 9 #ifndef _QEMU_VHOST_USER_RNG_H 10 #define _QEMU_VHOST_USER_RNG_H 11 12 #include "hw/virtio/virtio.h" 13 #include "hw/virtio/vhost.h" 14 #include "hw/virtio/vhost-user.h" 15 #include "chardev/char-fe.h" 16 17 #define TYPE_VHOST_USER_RNG "vhost-user-rng" 18 OBJECT_DECLARE_SIMPLE_TYPE(VHostUserRNG, VHOST_USER_RNG) 19 20 struct VHostUserRNG { 21 /*< private >*/ 22 VirtIODevice parent; 23 CharBackend chardev; 24 struct vhost_virtqueue *vhost_vq; 25 struct vhost_dev vhost_dev; 26 VhostUserState vhost_user; 27 VirtQueue *req_vq; 28 bool connected; 29 30 /*< public >*/ 31 }; 32 33 #endif /* _QEMU_VHOST_USER_RNG_H */ 34