From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Smnnh-00015O-Uw for qemu-devel@nongnu.org; Thu, 05 Jul 2012 11:17:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Smnnb-0001vV-GT for qemu-devel@nongnu.org; Thu, 05 Jul 2012 11:17:01 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:39325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Smnnb-0001v8-AI for qemu-devel@nongnu.org; Thu, 05 Jul 2012 11:16:55 -0400 Received: by yhoo21 with SMTP id o21so9365393yho.4 for ; Thu, 05 Jul 2012 08:16:52 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 5 Jul 2012 17:16:21 +0200 Message-Id: <1341501390-797-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH uq/master 0/9] remove event_notifier_get_fd from non-KVM code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, mst@redhat.com, jan.kiszka@siemens.com, mtosatti@redhat.com, avi@redhat.com, anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com This is part 1 of a three-part series that expands usage of EventNotifier in QEMU (including AIO and the main loop). I started working on this when playing with the threaded block layer; the part of that work that I hope will be in 1.2 is generalizing posix-aio-compat.c to be a generic portable thread pool + porting AIO to Win32 (part 2). On top of this, discard can be easily made asynchronous (part 3), which is a prerequisite for enabling it. This first part does the necessary changes for porting EventNotifier to Win32. The Win32 version will not have event_notifier_get_fd, and thus I want to remove all calls in portable code. Instead, all functions used in portable code after this series take an EventNotifier; KVM-specific implementations retrieve the file descriptor internally (these calls are in hw/ivshmem.c, hw/vhost.c, kvm-all.c). Patches 1 to 6 cover ivshmem and the memory API, first adding the required EventNotifier APIs and then using them. Patches 7 to 9 do the same with KVM ioeventfd and irqfd, refactoring transport-independent code in the process from virtio-pci to virtio (the two steps are a bit hard to separate). Paolo Bonzini (9): event_notifier: add event_notifier_set event_notifier: remove event_notifier_test event_notifier: add event_notifier_init_fd ivshmem: use EventNotifier and memory API ivshmem: wrap ivshmem_del_eventfd loops with transaction memory: pass EventNotifier, not eventfd event_notifier: add event_notifier_set_handler virtio: move common ioeventfd handling out of virtio-pci virtio: move common irqfd handling out of virtio-pci event_notifier.c | 30 ++++++++++++--------- event_notifier.h | 8 ++++-- exec.c | 8 +++--- hw/ivshmem.c | 67 +++++++++++++++++++++++++++-------------------- hw/vhost.c | 4 +-- hw/virtio-pci.c | 77 ++++++++++-------------------------------------------- hw/virtio.c | 46 ++++++++++++++++++++++++++++++++ hw/virtio.h | 3 +++ hw/xen_pt.c | 2 +- kvm-all.c | 29 +++++++++++++++----- kvm-stub.c | 10 +++++++ kvm.h | 2 ++ memory.c | 18 ++++++------- memory.h | 9 ++++--- xen-all.c | 6 +++-- 15 files changed, 186 insertions(+), 133 deletions(-) -- 1.7.10.2