From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azkMk-0000h1-S2 for qemu-devel@nongnu.org; Mon, 09 May 2016 08:32:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azkMf-0001Mg-P8 for qemu-devel@nongnu.org; Mon, 09 May 2016 08:32:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azkMf-0001MV-Ja for qemu-devel@nongnu.org; Mon, 09 May 2016 08:32:45 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0377B6265B for ; Mon, 9 May 2016 12:32:45 +0000 (UTC) References: <1461204268-7643-1-git-send-email-famz@redhat.com> <20160421144938-mutt-send-email-mst@redhat.com> <20160421142857.GB2220@ad.usersys.redhat.com> From: Paolo Bonzini Message-ID: <57308369.7070009@redhat.com> Date: Mon, 9 May 2016 14:32:41 +0200 MIME-Version: 1.0 In-Reply-To: <20160421142857.GB2220@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] virtio: Register host notifier handler as external List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Max Reitz 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 call= ed >> > 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 w= in32. > This is a subject understood best by Paolo but since he's on PTO I'll s= ee if I > can figure out the answer by testing this code with wine.