From patchwork Wed Apr 4 14:15:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 150731 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 09AC1B6FDF for ; Thu, 5 Apr 2012 00:17:54 +1000 (EST) Received: from localhost ([::1]:43094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFR1t-0004Rc-Uu for incoming@patchwork.ozlabs.org; Wed, 04 Apr 2012 10:17:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFR1j-0004QV-Hg for qemu-devel@nongnu.org; Wed, 04 Apr 2012 10:17:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SFR1d-0001yM-7k for qemu-devel@nongnu.org; Wed, 04 Apr 2012 10:17:35 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:55630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SFR1d-0001xY-3R for qemu-devel@nongnu.org; Wed, 04 Apr 2012 10:17:29 -0400 X-IronPort-AV: E=Sophos;i="4.75,369,1330923600"; d="scan'208";a="188989772" Received: from ftlpmailmx02.citrite.net ([10.13.107.66]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5; 04 Apr 2012 10:16:48 -0400 Received: from meteora.cam.xci-test.com (10.80.248.241) by smtprelay.citrix.com (10.13.107.66) with Microsoft SMTP Server id 8.3.213.0; Wed, 4 Apr 2012 10:16:16 -0400 From: Julien Grall To: qemu-devel@nongnu.org Date: Wed, 4 Apr 2012 15:15:41 +0100 Message-ID: <6645adb9b3662c620ef26b444feec1b02ca06ecc.1333548055.git.julien.grall@citrix.com> X-Mailer: git-send-email 1.7.2.5 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.63 Cc: Julien Grall , avi@redhat.com, Stefano.Stabellini@eu.citrix.com Subject: [Qemu-devel] [PATCH] memory: check address space when a listener is registered 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 This patch resolves a bug in memory listener registration. "range_add" callback was called on each section of the both address space (IO and memory space) even if it doesn't match the address space filter. Signed-off-by: Julien Grall --- memory.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index 22b0352..a9d237d 100644 --- a/memory.c +++ b/memory.c @@ -1444,6 +1444,11 @@ static void listener_add_address_space(MemoryListener *listener, { FlatRange *fr; + if (listener->address_space_filter + && listener->address_space_filter != as->root) { + return; + } + if (global_dirty_log) { listener->log_global_start(listener); }