From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:37825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwsSJ-0005Cg-2c for qemu-devel@nongnu.org; Thu, 21 Feb 2019 12:48:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwsSH-0004ql-7E for qemu-devel@nongnu.org; Thu, 21 Feb 2019 12:48:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48932) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gwsSF-0004og-8h for qemu-devel@nongnu.org; Thu, 21 Feb 2019 12:48:17 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C401181F2F for ; Thu, 21 Feb 2019 17:48:12 +0000 (UTC) Date: Thu, 21 Feb 2019 17:48:08 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20190221174808.GM2605@work-vm> References: <20190220115611.3192-1-quintela@redhat.com> <20190220115611.3192-3-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190220115611.3192-3-quintela@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 2/8] multifd: Rename "size" member to pages_alloc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org, Thomas Huth , Paolo Bonzini , Eric Blake , Laurent Vivier , Markus Armbruster * Juan Quintela (quintela@redhat.com) wrote: > 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 > --- > migration/ram.c | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) > > diff --git a/migration/ram.c b/migration/ram.c > index 8b5fd67d66..29f0d431a8 100644 > --- a/migration/ram.c > +++ b/migration/ram.c > @@ -531,8 +531,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[]; > @@ -718,8 +719,8 @@ static void multifd_send_fill_packet(MultiFDSendParams *p) > packet->magic = cpu_to_be32(MULTIFD_MAGIC); > packet->version = cpu_to_be32(MULTIFD_VERSION); > packet->flags = cpu_to_be32(p->flags); > - packet->size = cpu_to_be32(migrate_multifd_page_count()); > - packet->used = cpu_to_be32(p->pages->used); > + packet->pages_alloc = cpu_to_be32(migrate_multifd_page_count()); > + packet->pages_used = cpu_to_be32(p->pages->used); > packet->packet_num = cpu_to_be64(p->packet_num); > > if (p->pages->block) { > @@ -755,19 +756,19 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp) > > p->flags = be32_to_cpu(packet->flags); > > - packet->size = be32_to_cpu(packet->size); > - if (packet->size > migrate_multifd_page_count()) { > + packet->pages_alloc = 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; > } > > - p->pages->used = be32_to_cpu(packet->used); > - if (p->pages->used > packet->size) { > + p->pages->used = 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; > } > > -- > 2.20.1 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK