From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZorK5-0002lP-Gq for qemu-devel@nongnu.org; Wed, 21 Oct 2015 07:12:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZorK1-0003LL-CW for qemu-devel@nongnu.org; Wed, 21 Oct 2015 07:12:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZorK1-0003LG-7o for qemu-devel@nongnu.org; Wed, 21 Oct 2015 07:12:45 -0400 From: Juan Quintela In-Reply-To: <1443515898-3594-39-git-send-email-dgilbert@redhat.com> (David Alan Gilbert's message of "Tue, 29 Sep 2015 09:38:02 +0100") References: <1443515898-3594-1-git-send-email-dgilbert@redhat.com> <1443515898-3594-39-git-send-email-dgilbert@redhat.com> Date: Wed, 21 Oct 2015 13:12:42 +0200 Message-ID: <87r3koa311.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v8 38/54] Page request: Add MIG_RP_MSG_REQ_PAGES reverse command Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: aarcange@redhat.com, liang.z.li@intel.com, qemu-devel@nongnu.org, luis@cs.umu.se, bharata@linux.vnet.ibm.com, amit.shah@redhat.com, pbonzini@redhat.com "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. > > Two versions exist: > MIG_RP_MSG_REQ_PAGES_ID that includes a RAMBlock name and start/len > MIG_RP_MSG_REQ_PAGES that just has start/len for use with the same > RAMBlock as a previous MIG_RP_MSG_REQ_PAGES_ID > > Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela > diff --git a/migration/migration.c b/migration/migration.c > index 4f8ef6f..e994164 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -251,6 +251,35 @@ 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) > + * Start: Address offset within the RB > + * Len: Length in bytes required - must be a multiple of pagesize > + */ > +void migrate_send_rp_req_pages(MigrationIncomingState *mis, const char *rbname, > + ram_addr_t start, size_t len) > +{ > + uint8_t bufc[12 + 1 + 255]; /* start (8), len (4), rbname upto 256 */ > + size_t msglen = 12; /* start + len */ > + > + *(uint64_t *)bufc = cpu_to_be64((uint64_t)start); > + *(uint32_t *)(bufc + 8) = cpu_to_be32((uint32_t)len); struct foo { uint64_t start; uint32_t len; char msg[]; } As we are supposed to have the same qemu on both sides, this should work, no? Reviewed by anyways, because I am not sure that proposed solution is (even) better than current code. Later, Juan.