From nobody Mon Feb 9 17:36:15 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.zoho.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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1491485995526774.1843978136783; Thu, 6 Apr 2017 06:39:55 -0700 (PDT) Received: from localhost ([::1]:45898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cw7di-0007FP-7S for importer@patchew.org; Thu, 06 Apr 2017 09:39:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cw7BG-0006WS-4B for qemu-devel@nongnu.org; Thu, 06 Apr 2017 09:10:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cw7BF-000091-34 for qemu-devel@nongnu.org; Thu, 06 Apr 2017 09:10:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59336) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cw7BE-00008U-RP for qemu-devel@nongnu.org; Thu, 06 Apr 2017 09:10:29 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E981080498 for ; Thu, 6 Apr 2017 13:10:27 +0000 (UTC) Received: from secure.mitica (ovpn-117-221.ams2.redhat.com [10.36.117.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9223A2E87; Thu, 6 Apr 2017 13:10:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E981080498 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E981080498 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 6 Apr 2017 15:09:05 +0200 Message-Id: <20170406130913.2232-47-quintela@redhat.com> In-Reply-To: <20170406130913.2232-1-quintela@redhat.com> References: <20170406130913.2232-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 06 Apr 2017 13:10:28 +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 46/54] ram: ram_discard_range() don't use the mis parameter 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: dgilbert@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" Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- include/migration/migration.h | 3 +-- migration/postcopy-ram.c | 6 ++---- migration/ram.c | 9 +++------ migration/savevm.c | 3 +-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 2cd2007..b84ec3d 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -270,8 +270,7 @@ void ram_debug_dump_bitmap(unsigned long *todump, bool = expected); /* For outgoing discard bitmap */ int ram_postcopy_send_discard_bitmap(MigrationState *ms); /* For incoming postcopy discard */ -int ram_discard_range(MigrationIncomingState *mis, const char *block_name, - uint64_t start, size_t length); +int ram_discard_range(const char *block_name, uint64_t start, size_t lengt= h); int ram_postcopy_incoming_init(MigrationIncomingState *mis); void ram_postcopy_migrated_memory_release(MigrationState *ms); =20 diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 8756364..85fd8d7 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -213,8 +213,6 @@ out: static int init_range(const char *block_name, void *host_addr, ram_addr_t offset, ram_addr_t length, void *opaque) { - MigrationIncomingState *mis =3D opaque; - trace_postcopy_init_range(block_name, host_addr, offset, length); =20 /* @@ -223,7 +221,7 @@ static int init_range(const char *block_name, void *hos= t_addr, * - we're going to get the copy from the source anyway. * (Precopy will just overwrite this data, so doesn't need the discard) */ - if (ram_discard_range(mis, block_name, 0, length)) { + if (ram_discard_range(block_name, 0, length)) { return -1; } =20 @@ -271,7 +269,7 @@ static int cleanup_range(const char *block_name, void *= host_addr, */ int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pag= es) { - if (qemu_ram_foreach_block(init_range, mis)) { + if (qemu_ram_foreach_block(init_range, NULL)) { return -1; } =20 diff --git a/migration/ram.c b/migration/ram.c index 3f3842a..9ed91e5 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -782,7 +782,7 @@ static void ram_release_pages(const char *rbname, uint6= 4_t offset, int pages) return; } =20 - ram_discard_range(NULL, rbname, offset, pages << TARGET_PAGE_BITS); + ram_discard_range(rbname, offset, pages << TARGET_PAGE_BITS); } =20 /** @@ -1608,7 +1608,7 @@ void ram_postcopy_migrated_memory_release(MigrationSt= ate *ms) =20 while (run_start < range) { unsigned long run_end =3D find_next_bit(bitmap, range, run_sta= rt + 1); - ram_discard_range(NULL, block->idstr, run_start << TARGET_PAGE= _BITS, + ram_discard_range(block->idstr, run_start << TARGET_PAGE_BITS, (run_end - run_start) << TARGET_PAGE_BITS); run_start =3D find_next_zero_bit(bitmap, range, run_end + 1); } @@ -1948,15 +1948,12 @@ int ram_postcopy_send_discard_bitmap(MigrationState= *ms) * * Returns zero on success * - * @mis: current migration incoming state * @rbname: name of the RAMBlock of the request. NULL means the * same that last one. * @start: RAMBlock starting page * @length: RAMBlock size */ -int ram_discard_range(MigrationIncomingState *mis, - const char *rbname, - uint64_t start, size_t length) +int ram_discard_range(const char *rbname, uint64_t start, size_t length) { int ret =3D -1; =20 diff --git a/migration/savevm.c b/migration/savevm.c index bbf055d..7cf387f 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1479,8 +1479,7 @@ static int loadvm_postcopy_ram_handle_discard(Migrati= onIncomingState *mis, block_length =3D qemu_get_be64(mis->from_src_file); =20 len -=3D 16; - int ret =3D ram_discard_range(mis, ramid, start_addr, - block_length); + int ret =3D ram_discard_range(ramid, start_addr, block_length); if (ret) { return ret; } --=20 2.9.3