From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNXZV-0002YQ-CI for qemu-devel@nongnu.org; Thu, 06 Aug 2015 22:39:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNXZU-0002HE-5q for qemu-devel@nongnu.org; Thu, 06 Aug 2015 22:39:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNXZU-0002Gg-0m for qemu-devel@nongnu.org; Thu, 06 Aug 2015 22:39:48 -0400 Date: Thu, 6 Aug 2015 15:21:44 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150806142143.GF2251@work-vm> References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-31-git-send-email-dgilbert@redhat.com> <20150723065027.GQ10280@grmbl.mre> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150723065027.GQ10280@grmbl.mre> Subject: Re: [Qemu-devel] [PATCH v7 30/42] Page request: Add MIG_RP_MSG_REQ_PAGES reverse command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, quintela@redhat.com, liang.z.li@intel.com, qemu-devel@nongnu.org, luis@cs.umu.se, pbonzini@redhat.com, david@gibson.dropbear.id.au * Amit Shah (amit.shah@redhat.com) wrote: > On (Tue) 16 Jun 2015 [11:26:43], Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Add MIG_RP_MSG_REQ_PAGES command on Return path for the postcopy > > destination to request a page from the source. > > > > Signed-off-by: Dr. David Alan Gilbert > > > --- a/migration/migration.c > > +++ b/migration/migration.c > > @@ -113,6 +113,36 @@ static void deferred_incoming_migration(Error **errp) > > deferred_incoming = true; > > } > > > > +/* Request a range of pages from the source VM at the given > > + * start address. > > + * rbname: Name of the RAMBlock to request the page in, if NULL it's the same > > + * as the last request (a name must have been given previously) > > Why not just send the name all the time? It does shrink the messages quite a bit, and you have to do a name lookup on them when you receive it, rather than just knowing it's the same one. > > @@ -1010,6 +1058,28 @@ static void *source_return_path_thread(void *opaque) > > trace_source_return_path_thread_pong(tmp32); > > break; > > > > + case MIG_RP_MSG_REQ_PAGES: > > + start = be64_to_cpup((uint64_t *)buf); > > + len = be64_to_cpup(((uint64_t *)buf)+1); > > + tmpstr = NULL; > > + if (len & 1) { > > + len -= 1; /* Remove the flag */ > > + /* Now we expect an idstr */ > > + tmp32 = buf[16]; /* Length of the following idstr */ > > + tmpstr = (char *)&buf[17]; > > + buf[17+tmp32] = '\0'; > > + expected_len = 16+1+tmp32; > > Whitespace missing around operators Done. > > + } else { > > + expected_len = 16; > > + } > > This else can be removed if expected_len is set before the if That's simplified out with the change Juan suggested. Dave > > Amit -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK