From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm7eK-0006Ap-7i for qemu-devel@nongnu.org; Fri, 21 Dec 2012 13:48:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm7eD-0001le-Ht for qemu-devel@nongnu.org; Fri, 21 Dec 2012 13:48:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm7eD-0001lW-9T for qemu-devel@nongnu.org; Fri, 21 Dec 2012 13:48:41 -0500 Message-ID: <50D4AF05.1000107@redhat.com> Date: Fri, 21 Dec 2012 11:48:37 -0700 From: Eric Blake MIME-Version: 1.0 References: <1355725509-5429-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1355725509-5429-4-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1355725509-5429-4-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig8B88D1CEC5D7DE5202A45755" Subject: Re: [Qemu-devel] [PATCH 3/6] snapshot: design of common API to take snapshots List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, blauwirbel@gmail.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8B88D1CEC5D7DE5202A45755 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/16/2012 11:25 PM, Wenchao Xia wrote: > This patch added API to take snapshots in unified style for > both internal or external type. The core structure is based > on transaction, for that there is a qmp interface need to support > , qmp_transaction, so all operations are packed as requests. > In this way a sperate internal layer for snapshot is splitted > out from qmp layer, and now qmp can just translate the user request > and fill in internal API. Internal API use params defined inside > qemu, so other component inside qemu can use it without considering > the qmp's parameter format. >=20 > +typedef struct SNTime { > + uint32_t date_sec; /* UTC date of the snapshot */ Relative to what? Seconds since Epoch? Shouldn't this be 64-bits, to avoid wraparound problems in 2038? > +typedef struct BlkSnapshotInternal { > + /* caller input */ > + const char *sn_name; /* must be set in create/delete. */ > + BlockDriverState *bs; /* must be set in create/delete */ > + SNTime time; /* must be set in create. */ > + uint64_t vm_state_size; /* optional, default is 0, only valid in c= reate. */ > + /* following were used internal */ Prefer present tense: The following are for internal use > + > +/* for simple sync type params were all put here ignoring the differen= ce of > + different operation type as create/delete. */ > +typedef struct BlkTransactionStatesSync { Again, prefer present tense (avoid 'were' in comments). > +/* async snapshot, not supported now */ > +typedef struct BlkTransactionStatesAsync { > + int reserved; > +} BlkTransactionStatesAsync; Why declare a struct if we aren't supporting it yet? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig8B88D1CEC5D7DE5202A45755 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.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ1K8FAAoJEKeha0olJ0Nq9AQIAIZWbtdwEnnRPWGVjxSLcrGC a0YP2SxNtQat5cCTnlG4qVv6MgxmpzAZEgyS7OC3NcGwRvJAnYLp4KyUjYzFO8Xq F4y8iks2VEfpZZu1a+8H1AplsnJTR+FAGBneQFtUfJv+cFrA2fbzpsaPl/sJwj8L 14aZ4FF56dpfWjhYoK/bp9wpBRha6+mqcbeoD+u303tNw0vdlzk3RPlPoSfSThow Kr+YrlmdlWxFBRaKDL3xW5RO674IJ2xNe4nqCvIIddNMFAGZV9xa47xE+lV+FmDI Pwfj5dmQ3EFy1wcvoEUw3KuNuKLvEy0lqxXw9LrGP0ce4hvJ+zeqnXpO2bZ6jY8= =t6iO -----END PGP SIGNATURE----- --------------enig8B88D1CEC5D7DE5202A45755--