mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
libxc: suspend: Rename, improve xc_suspend_evtchn_init
xc_suspend_evtchn_init expects to eat the first event on the xce. If the xce is used for any other purpose then this can break. Document this fact and rename the function to xc_suspend_evtchn_init_exclusive. (I haven't checked the call sites for improper shared use of the xce.) Provide a corresponding xc_suspend_evtchn_init_sane which doesn't try to eat an event, and instead leaves the caller the ability to demultiplex. Also document that xc_await_suspend needs exclusive use of the xce. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com> CC: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> --- v3: Drop spurious addition of #include <assert.h>
This commit is contained in:
1 parent
66bff9fd49
commit
d310a8339c
6 files changed
+31
-9
No files matched your search
@@ -360,7 +360,7 @@ static int setup_suspend_evtchn(checkpoint_state* s)
|
||||
return -1;
|
||||
}
|
||||
|
||||
s->suspend_evtchn = xc_suspend_evtchn_init(s->xch, s->xce, s->domid, port);
|
||||
s->suspend_evtchn = xc_suspend_evtchn_init_exclusive(s->xch, s->xce, s->domid, port);
|
||||
if (s->suspend_evtchn < 0) {
|
||||
s->errstr = "failed to bind suspend event channel";
|
||||
return -1;
|
||||
|
||||