diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-13 00:27:09 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-12 08:57:10 -0400 |
commit | df60aeef4f4fe0645d9a195a7689005520422de5 (patch) | |
tree | 3cfa3c4a986436c8accd5f0a57d5a6f70f1b7965 /drivers/lguest/core.c | |
parent | 5718607bb670c721f45f0dbb1cc7d6c64969aab1 (diff) |
lguest: use eventfds for device notification
Currently, when a Guest wants to perform I/O it calls LHCALL_NOTIFY with
an address: the main Launcher process returns with this address, and figures
out what device to run.
A far nicer model is to let processes bind an eventfd to an address: if we
find one, we simply signal the eventfd.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Davide Libenzi <davidel@xmailserver.org>
Diffstat (limited to 'drivers/lguest/core.c')
-rw-r--r-- | drivers/lguest/core.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c index d0298dc45d97..508569c9571a 100644 --- a/drivers/lguest/core.c +++ b/drivers/lguest/core.c | |||
@@ -198,9 +198,11 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user) | |||
198 | /* It's possible the Guest did a NOTIFY hypercall to the | 198 | /* It's possible the Guest did a NOTIFY hypercall to the |
199 | * Launcher, in which case we return from the read() now. */ | 199 | * Launcher, in which case we return from the read() now. */ |
200 | if (cpu->pending_notify) { | 200 | if (cpu->pending_notify) { |
201 | if (put_user(cpu->pending_notify, user)) | 201 | if (!send_notify_to_eventfd(cpu)) { |
202 | return -EFAULT; | 202 | if (put_user(cpu->pending_notify, user)) |
203 | return sizeof(cpu->pending_notify); | 203 | return -EFAULT; |
204 | return sizeof(cpu->pending_notify); | ||
205 | } | ||
204 | } | 206 | } |
205 | 207 | ||
206 | /* Check for signals */ | 208 | /* Check for signals */ |