From patchwork Wed Oct 3 16:03:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 188855 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 825812C00C2 for ; Thu, 4 Oct 2012 03:19:52 +1000 (EST) Received: from localhost ([::1]:51252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJRS4-0008JE-TW for incoming@patchwork.ozlabs.org; Wed, 03 Oct 2012 12:05:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJRRC-0006OV-Jv for qemu-devel@nongnu.org; Wed, 03 Oct 2012 12:04:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJRR4-0007qh-Px for qemu-devel@nongnu.org; Wed, 03 Oct 2012 12:04:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJRR4-0007qU-G0 for qemu-devel@nongnu.org; Wed, 03 Oct 2012 12:04:34 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q93G4VpI008338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Oct 2012 12:04:31 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q93G47Is016728; Wed, 3 Oct 2012 12:04:29 -0400 From: Avi Kivity To: qemu-devel@nongnu.org, Anthony Liguori , liu ping fan , "Michael S. Tsirkin" , Paolo Bonzini , Blue Swirl Date: Wed, 3 Oct 2012 18:03:53 +0200 Message-Id: <1349280245-16341-11-git-send-email-avi@redhat.com> In-Reply-To: <1349280245-16341-1-git-send-email-avi@redhat.com> References: <1349280245-16341-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC v1 10/22] vfio: use new MEMORY_LISTENER_DEFAULT_OPS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Removes quite a bit of useless code. Signed-off-by: Avi Kivity Acked-by: Alex Williamson --- hw/vfio_pci.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index a1eeced..8e49535 100644 --- a/hw/vfio_pci.c +++ b/hw/vfio_pci.c @@ -803,25 +803,6 @@ static int vfio_dma_unmap(VFIOContainer *container, return 0; } -static void vfio_listener_dummy1(MemoryListener *listener) -{ - /* We don't do batching (begin/commit) or care about logging */ -} - -static void vfio_listener_dummy2(MemoryListener *listener, - MemoryRegionSection *section) -{ - /* We don't do logging or care about nops */ -} - -static void vfio_listener_dummy3(MemoryListener *listener, - MemoryRegionSection *section, - bool match_data, uint64_t data, - EventNotifier *e) -{ - /* We don't care about eventfds */ -} - static bool vfio_listener_skipped_section(MemoryRegionSection *section) { return !memory_region_is_ram(section->mr); @@ -913,18 +894,9 @@ static void vfio_listener_region_del(MemoryListener *listener, } static MemoryListener vfio_memory_listener = { - .begin = vfio_listener_dummy1, - .commit = vfio_listener_dummy1, + MEMORY_LISTENER_DEFAULT_OPS, .region_add = vfio_listener_region_add, .region_del = vfio_listener_region_del, - .region_nop = vfio_listener_dummy2, - .log_start = vfio_listener_dummy2, - .log_stop = vfio_listener_dummy2, - .log_sync = vfio_listener_dummy2, - .log_global_start = vfio_listener_dummy1, - .log_global_stop = vfio_listener_dummy1, - .eventfd_add = vfio_listener_dummy3, - .eventfd_del = vfio_listener_dummy3, }; static void vfio_listener_release(VFIOContainer *container)