From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYHGA-0005fb-21 for qemu-devel@nongnu.org; Fri, 03 May 2013 10:46:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYHG5-0007du-74 for qemu-devel@nongnu.org; Fri, 03 May 2013 10:46:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYHG4-0007dn-SS for qemu-devel@nongnu.org; Fri, 03 May 2013 10:46:49 -0400 Message-ID: <5183CDCE.70005@redhat.com> Date: Fri, 03 May 2013 08:46:38 -0600 From: Eric Blake MIME-Version: 1.0 References: <1367461606-7554-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1367461606-7554-6-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1367461606-7554-6-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2HUGMKXRAWFJRWMUHRRLJ" Subject: Re: [Qemu-devel] [PATCH V4 5/5] block: make all steps in qmp_transaction() as callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, dietmar@proxmox.com, stefanha@gmail.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2HUGMKXRAWFJRWMUHRRLJ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/01/2013 08:26 PM, Wenchao Xia wrote: > Make it easier to add other operations to qmp_transaction() by using > callbacks, with external snapshots serving as an example implementation= > of the callbacks. >=20 > Signed-off-by: Wenchao Xia > --- > blockdev.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++------= ------- > 1 files changed, 71 insertions(+), 21 deletions(-) >=20 > +/* > + * This structure must be arranged as first member in parent type, ass= uming To me, "parent type" seems like the wrong relationship - in C++, the parent type is the smaller type, and the child type is the larger type that includes the parent type as its first member. That is, BlkTransationStates IS the parent type, and the comment would read better as "first member in child type". > + * that compiler will also arrange it to the same address with parent = instance. > + * Later it will be used in free(). > + */ > +struct BlkTransactionStates { > + BlockdevAction *action; > + const BdrvActionOps *ops; > + QSIMPLEQ_ENTRY(BlkTransactionStates) entry; > +}; > =20 > =20 > /* Now we are going to do the actual pivot. Everything up to this= point > * is reversible, but we are committed at this point */ Is this comment still correct, now that things are extensible, or should you s/pivot/commit/? If you do respin, I agree that s/rollback/abort/ might be a nicer name for that particular callback. But I'm also quite okay with using the patch as-is without a respin (while I pointed out two possible comment wording changes, they don't make or break the patch for me). Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2HUGMKXRAWFJRWMUHRRLJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRg83OAAoJEKeha0olJ0NqtIsH/0yw4mRxf8/18HDc68oEmGEc jep7OCxtt8J7K/OWTX0b43z7VACckfVWdsC84bxtMiz5++YvuXySgxhY8aEbvQ2D vSkUTCEIkIoJQI0FEL2mAD/uxIgOJw1N4fl6vKU9oLbbwkSOHwBgjHjRORfCaiQG dI1MTeBBEKjM++dTpNVwyQVh/ddtdzRi9k45eF4h4itB3fTcJ0K6hyKPH3yGNqol kqUl4jEV4UP4tDtdb/VI8UUlAaIHCCDCzTCLb0f1XDu0IU5M8qcVsyg5Kx7wa7yC 3PQUckmNflaoq4PUQ+17I97oKBxWOEhxL4ITIw3NzwRflCGhFtLNB2pmkF96t/U= =tbFj -----END PGP SIGNATURE----- ------enig2HUGMKXRAWFJRWMUHRRLJ--