From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1budLA-0004kL-Gf for qemu-devel@nongnu.org; Thu, 13 Oct 2016 06:34:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1budL6-0003bA-8g for qemu-devel@nongnu.org; Thu, 13 Oct 2016 06:34:19 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45173 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1budL6-0003al-3Q for qemu-devel@nongnu.org; Thu, 13 Oct 2016 06:34:16 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9DAYDSx105677 for ; Thu, 13 Oct 2016 06:34:15 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2626bnxxr2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 13 Oct 2016 06:34:14 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Oct 2016 11:34:11 +0100 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> <8b8b373d-34e9-00f3-9657-0ac4b5ade586@linux.vnet.ibm.com> <20161012145936.GB13343@work-vm> From: Halil Pasic Date: Thu, 13 Oct 2016 12:33:30 +0200 MIME-Version: 1.0 In-Reply-To: <20161012145936.GB13343@work-vm> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wELnDBisLvQ7istrvsgFgHcgVTx6QvP3F" Message-Id: <0cf06165-ff45-b985-c6d3-ccf02d9f6eff@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [QEMU PATCH v5 3/6] migration: extend VMStateInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: Paolo Bonzini , Jianjun Duan , qemu-devel@nongnu.org, veroniabahaa@gmail.com, peter.maydell@linaro.org, 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wELnDBisLvQ7istrvsgFgHcgVTx6QvP3F From: Halil Pasic To: "Dr. David Alan Gilbert" Cc: Paolo Bonzini , Jianjun Duan , qemu-devel@nongnu.org, veroniabahaa@gmail.com, peter.maydell@linaro.org, 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 Message-ID: <0cf06165-ff45-b985-c6d3-ccf02d9f6eff@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [QEMU PATCH v5 3/6] migration: extend VMStateInfo 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> <8b8b373d-34e9-00f3-9657-0ac4b5ade586@linux.vnet.ibm.com> <20161012145936.GB13343@work-vm> In-Reply-To: <20161012145936.GB13343@work-vm> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10/12/2016 04:59 PM, Dr. David Alan Gilbert wrote: >> Paolo I agree on a theoretical level. It's just I do not see why this >> > particular change makes the API simpler. In my opinion this complica= tes >> > things because now all VMStateInfo's can do funky stuff. Having addi= tional >> > state you can poke is rarely a simplification. Same goes for lots >> > of arguments especially if some of them are barely ever used. These >> > additional parameters contribute nothing for the large majority >> > of the cases (except maybe some head scratching when reading >> > the code). > I think it might depend how many VMStateInfo's we have. > My ideal rule would be there are no .get/.put implementations outside > of migration/ and we can trust that they would never do anything silly = (right?); Your statement about ideally no .get/.put implementations outside of migration/ is consistent with my initial understanding of VMStateInfo:= It's there to take care of the marshaling between the on wire representat= ion and the in memory representation of a single and preferably primitive vmstate field (not consisting of further fields). Complex stuff like arrays, structs, indirection via pointers and possibly allocation is preferably handled elsewhere. So VMStateInfo is the basic building stones= , and the only place which should write to/read from the stream (in ideal vmstate). So in a perfect vmstate world complete type of VMStateInfo is not part of= the API (you do not care about how it's done outside vmstate/), but only the (possibly pointers to) VMStateInfo's supported by the vmstate API. Of course this is not realistic, at least at the moment. On the other hand if VMStateInfo is meant for complete customization, as Jianjun has put it, then it obviously has to be a full fledged member of the API, and I think then your ideal rule makes no sense to me. I also do think we will always need something for handling special cases because we need to maintain compatibility -- see virtio migration for example. > so the extra parameters aren't going to be misused too badly. >=20 What would you consider bad misuse? I do not see this as a big concern at the moment. Cheers, Halil > However, we're probably quite a way from pulling all of the weirder > .get/.put implementations back in. >=20 > Dave >=20 --wELnDBisLvQ7istrvsgFgHcgVTx6QvP3F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iQIcBAEBAgAGBQJX/2MWAAoJEA0vhuyXGx0AKBgQAKqm5DG/y2WIIXMfr9/I4KPn DA/Sqqh6QilaWb2wHUZ2/ZUpA9hMMuwOPx8cIYu2/zSECwNW/FxlPkfaP8hJCvNh 5pleDwoyd8YZS3IGdFVJErZNZD2kLb+Vqbr53X12pXzfXLCAWu1f8LbanMsrq7NT oNlN6/KWLJ0f7SxMqzSJFx4ZMiU0QM/v5+poR7DAzVK7FHLgRMhwQhFXEfn/Czs4 PbW/uH75u6hGreV91FbnZ/6QJnbK87rNPXyEBFm+P+QatcpH59CaW5UCbbSN+QrQ Vo9voFgs8TzUfFQ3Mt0dABx1+Qxsjb2QTyJBBJB//HFmNWRk1DZzdMjXjgX+nUx2 DHrhYlidlFK+Psf4B/DTWSRJXE1RYz8W5h//QlpWYK5E3qpuYBSFI2UM+IxmQG1v YS/xEs0Gs1RxzHPKCOkkG+ULg9r8+MQxIv8jJQO20baDwmztSjTQHLm+wew9ado3 lZWrjDb2d5SJg22CKdsuYyPtM9Na4eH6qtEYUtqLGs97GS3Mz3gohNwmSbbmNJG2 rbcwSrpnB6MqJauYnhG+wM5hQGO8vQC1u4qO/TEU6BdZTy1G8y1DWEZiphvBrzPb jdKLwOMvgdmkDbO/H8eQZU/CkmgPGzqdqg3kP/DpwxcTS4y8irIblMaBGgpXXzuA lDGI2oyf2cVFTKnVUq4P =Hsev -----END PGP SIGNATURE----- --wELnDBisLvQ7istrvsgFgHcgVTx6QvP3F--