On 21/04/2016 16:28, Fam Zheng wrote:
>> > Is this the right thing to do in all cases?
>> > E.g. it doesn't look like event_notifier_set_handler previously called
>> > aio_set_event_notifier on win32. Was there a reason for this?
> It's a good catch. I'm not sure whether/how win32 goes with ioeventfd
Fam's patch is okay. While POSIX has only file descriptors, Windows has
socket descriptors and handles. EventNotifier is a handle, so it must
use aio_set_event_notifier or qemu_add_wait_object.
Fam changed qemu_add_wait_object to the corresponding AioContext-based
function.
qemu_add_wait_object and qemu_del_wait_object probably should go away,
replaced by a new function aio_set_wait_handler. Windows's
aio_set_event_notifier then can simply become
aio_set_wait_handler(ctx, event_notifier_get_handle(e), is_external,
io_notify, e);
similar to how POSIX implements it with
aio_set_fd_handler(ctx, event_notifier_get_fd(e),
is_external, (IOHandler *)io_read, NULL, e);
Thanks,
Paolo
> , but it
> seems all the existing host notifier handling (fd handler) in vhost and data
> plane mismatch with the event notifier implementation (WaitObject) in win32.
> This is a subject understood best by Paolo but since he's on PTO I'll see if I
> can figure out the answer by testing this code with wine.