From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWEn-0001fg-SJ for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:53:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvWEk-0006Dg-Hl for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:53:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWEk-0006Dc-AK for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:53:14 -0500 Message-ID: <50F6DAF6.9050005@redhat.com> Date: Wed, 16 Jan 2013 09:53:10 -0700 From: Eric Blake MIME-Version: 1.0 References: <1358353497-5292-1-git-send-email-benoit@irqsave.net> <1358353497-5292-4-git-send-email-benoit@irqsave.net> In-Reply-To: <1358353497-5292-4-git-send-email-benoit@irqsave.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2AAKHKTOAPOBDNIDMIJJE" Subject: Re: [Qemu-devel] [RFC V5 03/36] qcow2: Add qcow2_dedup_read_missing_and_concatenate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2AAKHKTOAPOBDNIDMIJJE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/16/2013 09:24 AM, Beno=C3=AEt Canet wrote: > This function is used to read missing data when unaligned writes are > done. This function also concatenate missing data with the given > qiov data in order to prepare a buffer used to look for duplicated > clusters. >=20 > Signed-off-by: Benoit Canet > --- > block/Makefile.objs | 1 + > block/qcow2-dedup.c | 119 +++++++++++++++++++++++++++++++++++++++++++= ++++++++ > block/qcow2.c | 36 +++++++++++++++- > block/qcow2.h | 12 ++++++ > 4 files changed, 167 insertions(+), 1 deletion(-) > create mode 100644 block/qcow2-dedup.c I'm not an expert in this area of code, so I didn't review it closely. However, I did notice this: > +++ b/block/qcow2.c > @@ -69,7 +69,6 @@ static int qcow2_probe(const uint8_t *buf, int buf_si= ze, const char *filename) > return 0; > } > =20 > - > /*=20 > * read qcow2 extension and fill bs > * start reading from start_offset Spurious whitespace change. > @@ -1110,6 +1109,41 @@ fail: > return ret; > } > =20 > +/** > + * Read some data from the QCOW2 file > + * > + * Important: s->lock is dropped. Things can change before the functio= n return s/return/returns/ > + * to the caller. > + * > + * @data: the buffer where the data must be stored > + * @sector_num: the sector number to read in the QCOW2 file > + * @nb_sectors: the number of sectors to read > + * @ret: negative on error > + */ > +int qcow2_read_cluster_data(BlockDriverState *bs, > + uint8_t *data, > + uint64_t sector_num, > + int nb_sectors) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2AAKHKTOAPOBDNIDMIJJE 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/ iQEcBAEBCAAGBQJQ9tr2AAoJEKeha0olJ0NqANYIAIJGwH52ZkMq1K2MM0oGtE41 2/PSinQlzA4ofXxVJyYGMLP60oW30fZ3Bne0LIhAph5nvrvLh0yi6/tMV+MfpdlY LUHi7kmsE3+365CO/4cP2IDpLdJEHRjjdD5jgalgHxsJfx6X1FSILenE8zQj1s8Q RKhlynaNuQOOyyS+or3CPlzOeWaiCesGiuPhmTc3qUpyUyB9stRg2HEZW6T5/AFG nwts28nji0K9LRHvbiKvQLFG2MyACMhEgpiG3opgqY/nhs0SL7uCkj72rejXZwSa pWbaF0/eE9Legd8B/4HYFtEUPlJ6EGvfk+loOFtktctcTcCO5uF/46UKmAIPZpU= =mtlR -----END PGP SIGNATURE----- ------enig2AAKHKTOAPOBDNIDMIJJE--