From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZH7yB-0004nh-Kc for qemu-devel@nongnu.org; Mon, 20 Jul 2015 06:06:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZH7y7-0000eO-FD for qemu-devel@nongnu.org; Mon, 20 Jul 2015 06:06:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZH7y7-0000eG-AB for qemu-devel@nongnu.org; Mon, 20 Jul 2015 06:06:43 -0400 Date: Mon, 20 Jul 2015 15:36:20 +0530 From: Amit Shah Message-ID: <20150720100620.GA10280@grmbl.mre> References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-19-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-19-git-send-email-dgilbert@redhat.com> Subject: Re: [Qemu-devel] [PATCH v7 18/42] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages. 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:31], Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > The state of the postcopy process is managed via a series of messages; > * Add wrappers and handlers for sending/receiving these messages > * Add state variable that track the current state of postcopy > > Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah But: > +void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name, > + uint16_t len, > + uint64_t *start_list, > + uint64_t *end_list) > +{ > + uint8_t *buf; > + uint16_t tmplen; > + uint16_t t; > + size_t name_len = strlen(name); > + > + trace_qemu_savevm_send_postcopy_ram_discard(name, len); > + buf = g_malloc0(len*16 + name_len + 3); > + buf[0] = 0; /* Version */ > + assert(name_len < 256); > + buf[1] = name_len; > + memcpy(buf+2, name, name_len); > + tmplen = 2+name_len; > + buf[tmplen++] = '\0'; whitespace around operators missing > +static int loadvm_postcopy_ram_handle_discard(MigrationIncomingState *mis, > + uint16_t len) > + len -= 3+strlen(ramid); ditto Amit