From nobody Tue Oct 28 12:15:20 2025 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 1515588606642330.22936612289016; Wed, 10 Jan 2018 04:50:06 -0800 (PST) Received: from localhost ([::1]:39001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZFpR-0007Pj-6d for importer@patchew.org; Wed, 10 Jan 2018 07:50:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZFn6-00064A-Rm for qemu-devel@nongnu.org; Wed, 10 Jan 2018 07:47:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZFn5-0004Nl-NA for qemu-devel@nongnu.org; Wed, 10 Jan 2018 07:47:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54054) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZFn5-0004Mj-FP for qemu-devel@nongnu.org; Wed, 10 Jan 2018 07:47:35 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 968AD7CB89 for ; Wed, 10 Jan 2018 12:47:34 +0000 (UTC) Received: from secure.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3645F7B8DC; Wed, 10 Jan 2018 12:47:32 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 10 Jan 2018 13:47:12 +0100 Message-Id: <20180110124723.11879-4-quintela@redhat.com> In-Reply-To: <20180110124723.11879-1-quintela@redhat.com> References: <20180110124723.11879-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 10 Jan 2018 12:47:34 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v10 03/14] migration: Drop current address parameter from save_zero_page() 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: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com 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" It already has RAMBlock and offset, it can calculate it itself. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index cb1950f3eb..5a109efeda 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -907,11 +907,10 @@ static void migration_bitmap_sync(RAMState *rs) * @rs: current RAM state * @block: block that contains the page we want to send * @offset: offset inside the block for the page - * @p: pointer to the page */ -static int save_zero_page(RAMState *rs, RAMBlock *block, ram_addr_t offset, - uint8_t *p) +static int save_zero_page(RAMState *rs, RAMBlock *block, ram_addr_t offset) { + uint8_t *p =3D block->host + offset; int pages =3D -1; =20 if (is_zero_range(p, TARGET_PAGE_SIZE)) { @@ -984,7 +983,7 @@ static int ram_save_page(RAMState *rs, PageSearchStatus= *pss, bool last_stage) } } } else { - pages =3D save_zero_page(rs, block, offset, p); + pages =3D save_zero_page(rs, block, offset); if (pages > 0) { /* Must let xbzrle know, otherwise a previous (now 0'd) cached * page would be stale @@ -1160,7 +1159,7 @@ static int ram_save_compressed_page(RAMState *rs, Pag= eSearchStatus *pss, */ if (block !=3D rs->last_sent_block) { flush_compressed_data(rs); - pages =3D save_zero_page(rs, block, offset, p); + pages =3D save_zero_page(rs, block, offset); if (pages =3D=3D -1) { /* Make sure the first page is sent out before other pages= */ bytes_xmit =3D save_page_header(rs, rs->f, block, offset | @@ -1180,7 +1179,7 @@ static int ram_save_compressed_page(RAMState *rs, Pag= eSearchStatus *pss, ram_release_pages(block->idstr, offset, pages); } } else { - pages =3D save_zero_page(rs, block, offset, p); + pages =3D save_zero_page(rs, block, offset); if (pages =3D=3D -1) { pages =3D compress_page_with_multi_thread(rs, block, offse= t); } else { --=20 2.14.3