summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-06-25 10:34:09 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-11-16 08:36:13 -0600
commit5c74521d249486fa3e749dbbf6d56a70d4d7235f (patch)
tree2c70ecc569e7a7d64d4e7a799ff2fd7ed10c7e53 /include
parenta9b7b2ad7b075dba5495271706670e5c6b1304bc (diff)
downloadqemu-5c74521d249486fa3e749dbbf6d56a70d4d7235f.tar.gz
qemu-5c74521d249486fa3e749dbbf6d56a70d4d7235f.tar.bz2
qemu-5c74521d249486fa3e749dbbf6d56a70d4d7235f.zip
rng-random: add an RNG backend that uses /dev/random (v3)
The filename can be overridden but it expects a non-blocking source of entropy. A typical invocation would be: qemu -object rng-random,id=rng0 -device virtio-rng-pci,rng=rng0 This can also be used with /dev/urandom by using the command line: qemu -object rng-random,filename=/dev/urandom,id=rng0 \ -device virtio-rng-pci,rng=rng0 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - merged header split patch into this one v2 -> v3 - bug fix in rng-random (Paolo)
Diffstat (limited to 'include')
-rw-r--r--include/qemu/rng-random.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/qemu/rng-random.h b/include/qemu/rng-random.h
new file mode 100644
index 0000000000..6249290cc4
--- /dev/null
+++ b/include/qemu/rng-random.h
@@ -0,0 +1,22 @@
+/*
+ * QEMU Random Number Generator Backend
+ *
+ * Copyright IBM, Corp. 2012
+ *
+ * Authors:
+ * Anthony Liguori <aliguori@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_RNG_RANDOM_H
+#define QEMU_RNG_RANDOM_H
+
+#include "qemu/object.h"
+
+#define TYPE_RNG_RANDOM "rng-random"
+#define RNG_RANDOM(obj) OBJECT_CHECK(RndRandom, (obj), TYPE_RNG_RANDOM)
+
+typedef struct RndRandom RndRandom;
+
+#endif