Patchwork [1/4] rng-random: split out header for rng-random

login
register
mail settings
Submitter Anthony Liguori
Date Oct. 26, 2012, 5:21 p.m.
Message ID <1351272088-7942-2-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/194542/
State New
Headers show

Comments

Anthony Liguori - Oct. 26, 2012, 5:21 p.m.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 backends/rng-random.c     |  8 +++-----
 include/qemu/rng-random.h | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 5 deletions(-)
 create mode 100644 include/qemu/rng-random.h

Patch

diff --git a/backends/rng-random.c b/backends/rng-random.c
index 6b6e4b4..8325686 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -10,14 +10,12 @@ 
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/rng-random.h"
 #include "qemu/rng.h"
 #include "qerror.h"
 #include "main-loop.h"
 
-#define TYPE_RNG_RANDOM "rng-random"
-#define RNG_RANDOM(obj) OBJECT_CHECK(RndRandom, (obj), TYPE_RNG_RANDOM)
-
-typedef struct RndRandom
+struct RndRandom
 {
     RngBackend parent;
 
@@ -27,7 +25,7 @@  typedef struct RndRandom
     EntropyReceiveFunc *receive_func;
     void *opaque;
     size_t size;
-} RndRandom;
+};
 
 /**
  * A simple and incomplete backend to request entropy from /dev/random.
diff --git a/include/qemu/rng-random.h b/include/qemu/rng-random.h
new file mode 100644
index 0000000..6249290
--- /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