Received: from eggs.gnu.org ([2001:4830:134:3::10]:57868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buNKD-0000QB-3i for qemu-devel@nongnu.org; Wed, 12 Oct 2016 13:28:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buNK7-0002sL-Kk for qemu-devel@nongnu.org; Wed, 12 Oct 2016 13:28:16 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buNK7-0002s5-Cm for qemu-devel@nongnu.org; Wed, 12 Oct 2016 13:28:11 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9CHO8lG128719 for ; Wed, 12 Oct 2016 13:28:10 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 261qhdxve0-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 12 Oct 2016 13:28:09 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Oct 2016 11:28:09 -0600 References: <1475519097-27611-1-git-send-email-duanj@linux.vnet.ibm.com> <1475519097-27611-4-git-send-email-duanj@linux.vnet.ibm.com> <60b19618-e725-710f-f512-3f6df471f6f2@linux.vnet.ibm.com> From: Jianjun Duan Date: Wed, 12 Oct 2016 10:27:57 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Message-Id: <1b5c6891-1cd2-bf92-0b8b-a0cd9312442f@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [Qemu-ppc] [QEMU PATCH v5 3/6] migration: extend VMStateInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Halil Pasic , qemu-devel@nongnu.org Cc: veroniabahaa@gmail.com, peter.maydell@linaro.org, dgilbert@redhat.com, mst@redhat.com, quintela@redhat.com, mark.cave-ayland@ilande.co.uk, mdroth@linux.vnet.ibm.com, mreitz@redhat.com, blauwirbel@gmail.com, amit.shah@redhat.com, qemu-ppc@nongnu.org, kraxel@redhat.com, kwolf@redhat.com, dmitry@daynix.com, rth@twiddle.net, leon.alrae@imgtec.com, aurelien@aurel32.net, david@gibson.dropbear.id.au On 10/12/2016 05:07 AM, Paolo Bonzini wrote: > > > On 12/10/2016 13:59, Halil Pasic wrote: >> IMHO this would: >> * allow us to keep the good old MVStateInfo objects unmodified and >> the semantic of VMStateInfo unchanged >> * make clear that VMStateLinked does not care about the calculated size >> and provide a new anchor for documentation >> * if overloading the semantic of VMStateField.start is not desired we >> could put it into VMStateLinked, if needed we could also put more >> stuff in there >> * have clearer separation between special handling for (linked/certain) >> data structures and the usual scenario with the DAG. > > No, I disagree. We shouldn't be worried about making intrusive changes > to all invocations or declarations, if that leads to a simpler API. > If VMStateInfo was meant for complete customization, then it was missing some parts. I think the API is indeed simpler. Just like definition for VMStateField. Not all of its fields are used all time. > I agree that overloading .start can be a bit ugly but you can choose to > overload .num_offset instead, which is already better. > I did considered num_offset. But it is associated with an actual field. On the other hand, start means the start position of the q in the structure. So it is not that far stretched. >> I would also suggest unit tests in test/test-vmstate.c. Maybe with >> that the vmstate migration of QTAILQ could be factored out as a separate >> patch series. > > Yes, definitely. > This sounds a good idea. Will do it. > Paolo > Thanks, Jianjun