aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio.h
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2012-06-20 12:29:32 +0530
committerAnthony Liguori <aliguori@us.ibm.com>2012-11-16 08:36:13 -0600
commit16c915ba42b45df7a64a6908287f03bfa3764bed (patch)
tree34aa1b0948728b21ddf50d11798aecc654e1c890 /hw/virtio.h
parent1da2738f5566263177d09c1b9eaf7cbeeb17e815 (diff)
virtio-rng: hardware random number generator device
The Linux kernel already has a virtio-rng driver, this is the device implementation. When the guest asks for entropy from the virtio hwrng, it puts a buffer in the vq. We then put entropy into that buffer, and push it back to the guest. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- aliguori: converted to new RngBackend interface aliguori: remove entropy needed event aliguori: fix migration
Diffstat (limited to 'hw/virtio.h')
-rw-r--r--hw/virtio.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/virtio.h b/hw/virtio.h
index ac482be24c..df8d0f7b69 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -203,6 +203,8 @@ VirtIODevice *virtio_serial_init(DeviceState *dev, virtio_serial_conf *serial);
VirtIODevice *virtio_balloon_init(DeviceState *dev);
typedef struct VirtIOSCSIConf VirtIOSCSIConf;
VirtIODevice *virtio_scsi_init(DeviceState *dev, VirtIOSCSIConf *conf);
+typedef struct VirtIORNGConf VirtIORNGConf;
+VirtIODevice *virtio_rng_init(DeviceState *dev, VirtIORNGConf *conf);
#ifdef CONFIG_LINUX
VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf);
#endif
@@ -213,6 +215,7 @@ void virtio_blk_exit(VirtIODevice *vdev);
void virtio_serial_exit(VirtIODevice *vdev);
void virtio_balloon_exit(VirtIODevice *vdev);
void virtio_scsi_exit(VirtIODevice *vdev);
+void virtio_rng_exit(VirtIODevice *vdev);
#define DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) \
DEFINE_PROP_BIT("indirect_desc", _state, _field, \