From patchwork Tue Oct 9 16:32:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 190386 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 4435E2C024D for ; Wed, 10 Oct 2012 04:26:13 +1100 (EST) Received: from localhost ([::1]:44642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLcl6-0004kg-6p for incoming@patchwork.ozlabs.org; Tue, 09 Oct 2012 12:34:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLckK-0003j9-W8 for qemu-devel@nongnu.org; Tue, 09 Oct 2012 12:33:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLck2-0007MC-Ve for qemu-devel@nongnu.org; Tue, 09 Oct 2012 12:33:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLck2-0007Li-O0 for qemu-devel@nongnu.org; Tue, 09 Oct 2012 12:33:10 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q99GX8IG029993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Oct 2012 12:33:08 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q99GWrq5008429; Tue, 9 Oct 2012 12:33:04 -0400 From: Avi Kivity To: qemu-devel@nongnu.org, Anthony Liguori , liu ping fan , "Michael S. Tsirkin" , Paolo Bonzini , Blue Swirl Date: Tue, 9 Oct 2012 18:32:27 +0200 Message-Id: <1349800368-15228-3-git-send-email-avi@redhat.com> In-Reply-To: <1349800368-15228-1-git-send-email-avi@redhat.com> References: <1349800368-15228-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 02/23] vhost: use MemoryListener filtering to only monitor RAM address space 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 Instead of checking manually, let the listener filter for us. This prepares us for DMA address spaces. Signed-off-by: Avi Kivity --- hw/vhost.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index d0ce5aa..100f765 100644 --- a/hw/vhost.c +++ b/hw/vhost.c @@ -434,8 +434,7 @@ static void vhost_set_memory(MemoryListener *listener, static bool vhost_section(MemoryRegionSection *section) { - return section->address_space == get_system_memory() - && memory_region_is_ram(section->mr); + return memory_region_is_ram(section->mr); } static void vhost_begin(MemoryListener *listener) @@ -793,7 +792,7 @@ int vhost_dev_init(struct vhost_dev *hdev, int devfd, const char *devpath, hdev->log_size = 0; hdev->log_enabled = false; hdev->started = false; - memory_listener_register(&hdev->memory_listener, NULL); + memory_listener_register(&hdev->memory_listener, get_system_memory()); hdev->force = force; return 0; fail: