From nobody Sun Feb 8 19:55:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521120508679939.3427907453693; Thu, 15 Mar 2018 06:28:28 -0700 (PDT) Received: from localhost ([::1]:51537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewSva-0007F6-Ay for importer@patchew.org; Thu, 15 Mar 2018 09:28:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewSu7-0006cx-PX for qemu-devel@nongnu.org; Thu, 15 Mar 2018 09:26:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewSu4-0004ns-Hu for qemu-devel@nongnu.org; Thu, 15 Mar 2018 09:26:47 -0400 Received: from [112.64.68.174] (port=39093 helo=robinhe-hp.sh.intel.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewSu3-0004ks-KR for qemu-devel@nongnu.org; Thu, 15 Mar 2018 09:26:44 -0400 Received: from robinhe-hp.sh.intel.com (localhost [127.0.0.1]) by robinhe-hp (8.15.2/8.15.2/Debian-3) with ESMTP id w2D8XwVF018952; Tue, 13 Mar 2018 16:33:58 +0800 Received: (from robinhe@localhost) by robinhe-hp.sh.intel.com (8.15.2/8.15.2/Submit) id w2D8XwmO018951; Tue, 13 Mar 2018 16:33:58 +0800 From: junyan.he@intel.com To: qemu-devel@nongnu.org Date: Tue, 13 Mar 2018 16:33:47 +0800 Message-Id: <1520930033-18885-5-git-send-email-junyan.he@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520930033-18885-1-git-send-email-junyan.he@intel.com> References: <1520930033-18885-1-git-send-email-junyan.he@intel.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 112.64.68.174 Subject: [Qemu-devel] [PATCH 04/10] RFC: Set memory_region_set_log available for more client. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, famz@redhat.com, crosthwaite.peter@gmail.com, quintela@redhat.com, dgilbert@redhat.com, mreitz@redhat.com, Junyan He , pbonzini@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Junyan He We need to collect dirty log for nvdimm kind memory, need to enable memory_region_set_log for more clients rather than just VGA. Signed-off-by: Junyan He --- memory.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/memory.c b/memory.c index e70b64b..4a8a2fe 100644 --- a/memory.c +++ b/memory.c @@ -1921,11 +1921,12 @@ void memory_region_set_log(MemoryRegion *mr, bool l= og, unsigned client) uint8_t mask =3D 1 << client; uint8_t old_logging; =20 - assert(client =3D=3D DIRTY_MEMORY_VGA); - old_logging =3D mr->vga_logging_count; - mr->vga_logging_count +=3D log ? 1 : -1; - if (!!old_logging =3D=3D !!mr->vga_logging_count) { - return; + if (client =3D=3D DIRTY_MEMORY_VGA) { + old_logging =3D mr->vga_logging_count; + mr->vga_logging_count +=3D log ? 1 : -1; + if (!!old_logging =3D=3D !!mr->vga_logging_count) { + return; + } } =20 memory_region_transaction_begin(); --=20 2.7.4