summary refs log tree commit diff stats
path: root/include
diff options
context:
space:
mode:
authorLadi Prosek <lprosek@redhat.com>2016-03-03 09:37:17 +0100
committerAmit Shah <amit.shah@redhat.com>2016-03-03 17:42:26 +0530
commit9f14b0add1dcdbfa2ee61051d068211fb0a1fcc9 (patch)
treedc14b6dbc59318bed325db89f613160a7307bd5c /include
parent74074e8a7c60592cf1cc6469dbc2550d24aeded3 (diff)
downloadfocaccia-qemu-9f14b0add1dcdbfa2ee61051d068211fb0a1fcc9.tar.gz
focaccia-qemu-9f14b0add1dcdbfa2ee61051d068211fb0a1fcc9.zip
rng: move request queue cleanup from RngEgd to RngBackend
RngBackend is now in charge of cleaning up the linked list on
instance finalization. It also exposes a function to finalize
individual RngRequest instances, called by its child classes.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Message-Id: <1456994238-9585-4-git-send-email-lprosek@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/sysemu/rng.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h
index c744d82745..08a2eda2a4 100644
--- a/include/sysemu/rng.h
+++ b/include/sysemu/rng.h
@@ -60,6 +60,7 @@ struct RngBackend
     GSList *requests;
 };
 
+
 /**
  * rng_backend_request_entropy:
  * @s: the backend to request entropy from
@@ -78,4 +79,15 @@ struct RngBackend
 void rng_backend_request_entropy(RngBackend *s, size_t size,
                                  EntropyReceiveFunc *receive_entropy,
                                  void *opaque);
+
+/**
+ * rng_backend_free_request:
+ * @s: the backend that created the request
+ * @req: the request to finalize
+ *
+ * Used by child rng backend classes to finalize requests once they've been
+ * processed. The request is removed from the list of active requests and
+ * deleted.
+ */
+void rng_backend_finalize_request(RngBackend *s, RngRequest *req);
 #endif