From nobody Mon Nov 10 01:27:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552479209684942.319139353562; Wed, 13 Mar 2019 05:13:29 -0700 (PDT) Received: from localhost ([127.0.0.1]:43245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h42lC-0004Sa-Ft for importer@patchew.org; Wed, 13 Mar 2019 08:13:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h42ad-000435-Ia for qemu-devel@nongnu.org; Wed, 13 Mar 2019 08:02:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h42aX-0006Rl-UV for qemu-devel@nongnu.org; Wed, 13 Mar 2019 08:02:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38678) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h42aX-0006RU-MV for qemu-devel@nongnu.org; Wed, 13 Mar 2019 08:02:25 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5892C308623F for ; Wed, 13 Mar 2019 11:52:58 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-118.ams2.redhat.com [10.36.116.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64C711001E70; Wed, 13 Mar 2019 11:52:56 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 13 Mar 2019 12:51:13 +0100 Message-Id: <20190313115121.7611-3-quintela@redhat.com> In-Reply-To: <20190313115121.7611-1-quintela@redhat.com> References: <20190313115121.7611-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 13 Mar 2019 11:52:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/10] multifd: Rename "size" member to pages_alloc 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: Laurent Vivier , Thomas Huth , Juan Quintela , "Dr. David Alan Gilbert" , Markus Armbruster , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" It really indicates what is the number of allocated pages for one packet. Once there rename "used" to "pages_used". Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Juan Quintela --- migration/ram.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 3034f862c1..dc73829e25 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -594,8 +594,9 @@ typedef struct { uint32_t magic; uint32_t version; uint32_t flags; - uint32_t size; - uint32_t used; + /* maximum number of allocated pages */ + uint32_t pages_alloc; + uint32_t pages_used; uint64_t packet_num; char ramblock[256]; uint64_t offset[]; @@ -781,8 +782,8 @@ static void multifd_send_fill_packet(MultiFDSendParams = *p) packet->magic =3D cpu_to_be32(MULTIFD_MAGIC); packet->version =3D cpu_to_be32(MULTIFD_VERSION); packet->flags =3D cpu_to_be32(p->flags); - packet->size =3D cpu_to_be32(migrate_multifd_page_count()); - packet->used =3D cpu_to_be32(p->pages->used); + packet->pages_alloc =3D cpu_to_be32(migrate_multifd_page_count()); + packet->pages_used =3D cpu_to_be32(p->pages->used); packet->packet_num =3D cpu_to_be64(p->packet_num); =20 if (p->pages->block) { @@ -818,19 +819,19 @@ static int multifd_recv_unfill_packet(MultiFDRecvPara= ms *p, Error **errp) =20 p->flags =3D be32_to_cpu(packet->flags); =20 - packet->size =3D be32_to_cpu(packet->size); - if (packet->size > migrate_multifd_page_count()) { + packet->pages_alloc =3D be32_to_cpu(packet->pages_alloc); + if (packet->pages_alloc > migrate_multifd_page_count()) { error_setg(errp, "multifd: received packet " "with size %d and expected maximum size %d", - packet->size, migrate_multifd_page_count()) ; + packet->pages_alloc, migrate_multifd_page_count()) ; return -1; } =20 - p->pages->used =3D be32_to_cpu(packet->used); - if (p->pages->used > packet->size) { + p->pages->used =3D be32_to_cpu(packet->pages_used); + if (p->pages->used > packet->pages_alloc) { error_setg(errp, "multifd: received packet " - "with size %d and expected maximum size %d", - p->pages->used, packet->size) ; + "with %d pages and expected maximum pages are %d", + p->pages->used, packet->pages_alloc) ; return -1; } =20 --=20 2.20.1