From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIBKq-0003el-GC for qemu-devel@nongnu.org; Thu, 23 Jul 2015 03:54:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIBKm-00040g-Sa for qemu-devel@nongnu.org; Thu, 23 Jul 2015 03:54:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIBKm-00040U-NI for qemu-devel@nongnu.org; Thu, 23 Jul 2015 03:54:28 -0400 Date: Thu, 23 Jul 2015 12:20:27 +0530 From: Amit Shah Message-ID: <20150723065027.GQ10280@grmbl.mre> References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-31-git-send-email-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1434450415-11339-31-git-send-email-dgilbert@redhat.com> 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: "Dr. David Alan Gilbert (git)" 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 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? > @@ -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 > + } else { > + expected_len = 16; > + } This else can be removed if expected_len is set before the if Amit