1 From d615099455e3a6cc71c17182cabd851d4340354d Mon Sep 17 00:00:00 2001
2 From: Ladi Prosek <lprosek@redhat.com>
3 Date: Thu, 3 Mar 2016 09:37:15 +0100
4 Subject: [PATCH 1/5] rng: remove the unused request cancellation code
6 rng_backend_cancel_requests had no callers and none of the code
7 deleted in this commit ever ran.
9 Signed-off-by: Ladi Prosek <lprosek@redhat.com>
10 Reviewed-by: Amit Shah <amit.shah@redhat.com>
11 Message-Id: <1456994238-9585-2-git-send-email-lprosek@redhat.com>
12 Signed-off-by: Amit Shah <amit.shah@redhat.com>
14 backends/rng-egd.c | 12 ------------
15 backends/rng.c | 9 ---------
16 include/sysemu/rng.h | 11 -----------
17 3 files changed, 32 deletions(-)
19 diff --git a/backends/rng-egd.c b/backends/rng-egd.c
20 index 6c13409..3c6362e 100644
21 --- a/backends/rng-egd.c
22 +++ b/backends/rng-egd.c
23 @@ -124,17 +124,6 @@ static void rng_egd_free_requests(RngEgd *s)
27 -static void rng_egd_cancel_requests(RngBackend *b)
29 - RngEgd *s = RNG_EGD(b);
31 - /* We simply delete the list of pending requests. If there is data in the
32 - * queue waiting to be read, this is okay, because there will always be
33 - * more data than we requested originally
35 - rng_egd_free_requests(s);
38 static void rng_egd_opened(RngBackend *b, Error **errp)
40 RngEgd *s = RNG_EGD(b);
41 @@ -212,7 +201,6 @@ static void rng_egd_class_init(ObjectClass *klass, void *data)
42 RngBackendClass *rbc = RNG_BACKEND_CLASS(klass);
44 rbc->request_entropy = rng_egd_request_entropy;
45 - rbc->cancel_requests = rng_egd_cancel_requests;
46 rbc->opened = rng_egd_opened;
49 diff --git a/backends/rng.c b/backends/rng.c
50 index 5065fdc..5d1876c 100644
53 @@ -25,15 +25,6 @@ void rng_backend_request_entropy(RngBackend *s, size_t size,
57 -void rng_backend_cancel_requests(RngBackend *s)
59 - RngBackendClass *k = RNG_BACKEND_GET_CLASS(s);
61 - if (k->cancel_requests) {
62 - k->cancel_requests(s);
66 static bool rng_backend_prop_get_opened(Object *obj, Error **errp)
68 RngBackend *s = RNG_BACKEND(obj);
69 diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h
70 index 0a27c9b..c7da17d 100644
71 --- a/include/sysemu/rng.h
72 +++ b/include/sysemu/rng.h
73 @@ -38,7 +38,6 @@ struct RngBackendClass
75 void (*request_entropy)(RngBackend *s, size_t size,
76 EntropyReceiveFunc *receive_entropy, void *opaque);
77 - void (*cancel_requests)(RngBackend *s);
79 void (*opened)(RngBackend *s, Error **errp);
81 @@ -69,14 +68,4 @@ struct RngBackend
82 void rng_backend_request_entropy(RngBackend *s, size_t size,
83 EntropyReceiveFunc *receive_entropy,
87 - * rng_backend_cancel_requests:
88 - * @s: the backend to cancel all pending requests in
90 - * Cancels all pending requests submitted by @rng_backend_request_entropy. This
91 - * should be used by a device during reset or in preparation for live migration
92 - * to stop tracking any request.
94 -void rng_backend_cancel_requests(RngBackend *s);