@@ -14,14 +14,13 @@
#include "sysemu/rng.h"
#include "sysemu/rng-random.h"
+#include "linux/virtio_rng.h"
+#include "linux/virtio_ids.h"
#define TYPE_VIRTIO_RNG "virtio-rng-device"
#define VIRTIO_RNG(obj) \
OBJECT_CHECK(VirtIORNG, (obj), TYPE_VIRTIO_RNG)
-/* The Virtio ID for the virtio rng device */
-#define VIRTIO_ID_RNG 4
-
struct VirtIORNGConf {
RngBackend *rng;
uint64_t max_bytes;
new file mode 100644
@@ -0,0 +1,8 @@
+#ifndef _LINUX_VIRTIO_RNG_H
+#define _LINUX_VIRTIO_RNG_H
+/* This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers. */
+#include <linux/virtio_ids.h>
+#include <linux/virtio_config.h>
+
+#endif /* _LINUX_VIRTIO_RNG_H */
It's easier to keep everything in sync if we just use linux headers for virtio constants. Add virtio_rng.h header from linux 3.10-rc1, and remove duplicate symbols from virtio-rng.h Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- include/hw/virtio/virtio-rng.h | 5 ++--- linux-headers/linux/virtio_rng.h | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 linux-headers/linux/virtio_rng.h