48 lines
1.4 KiB
Diff
48 lines
1.4 KiB
Diff
|
# Commit a622b5ade2bdf79ad95e6088a4041e75253c43f3
|
||
|
# Date 2015-06-16 12:30:16 +0200
|
||
|
# Author David Vrabel <david.vrabel@citrix.com>
|
||
|
# Committer Jan Beulich <jbeulich@suse.com>
|
||
|
evtchn: factor out freeing an event channel
|
||
|
|
||
|
We're going to want to free an event channel from two places. Factor out
|
||
|
the code into a free_evtchn() function.
|
||
|
|
||
|
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
|
||
|
|
||
|
--- sle12sp1.orig/xen/common/event_channel.c 2015-07-08 12:33:47.000000000 +0200
|
||
|
+++ sle12sp1/xen/common/event_channel.c 2015-07-08 13:53:49.000000000 +0200
|
||
|
@@ -194,6 +194,17 @@ static int get_free_port(struct domain *
|
||
|
return port;
|
||
|
}
|
||
|
|
||
|
+static void free_evtchn(struct domain *d, struct evtchn *chn)
|
||
|
+{
|
||
|
+ /* Clear pending event to avoid unexpected behavior on re-bind. */
|
||
|
+ evtchn_port_clear_pending(d, chn);
|
||
|
+
|
||
|
+ /* Reset binding to vcpu0 when the channel is freed. */
|
||
|
+ chn->state = ECS_FREE;
|
||
|
+ chn->notify_vcpu_id = 0;
|
||
|
+
|
||
|
+ xsm_evtchn_close_post(chn);
|
||
|
+}
|
||
|
|
||
|
static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
|
||
|
{
|
||
|
@@ -571,14 +582,7 @@ static long __evtchn_close(struct domain
|
||
|
BUG();
|
||
|
}
|
||
|
|
||
|
- /* Clear pending event to avoid unexpected behavior on re-bind. */
|
||
|
- evtchn_port_clear_pending(d1, chn1);
|
||
|
-
|
||
|
- /* Reset binding to vcpu0 when the channel is freed. */
|
||
|
- chn1->state = ECS_FREE;
|
||
|
- chn1->notify_vcpu_id = 0;
|
||
|
-
|
||
|
- xsm_evtchn_close_post(chn1);
|
||
|
+ free_evtchn(d1, chn1);
|
||
|
|
||
|
out:
|
||
|
if ( d2 != NULL )
|