From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKoA7-0001Ge-FA for qemu-devel@nongnu.org; Wed, 06 Jul 2016 10:50:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKoA6-0000af-GQ for qemu-devel@nongnu.org; Wed, 06 Jul 2016 10:50:51 -0400 References: <1467732272-23368-1-git-send-email-clord@redhat.com> <1467732272-23368-11-git-send-email-clord@redhat.com> From: Max Reitz Message-ID: <763eeaa7-5906-78e1-7227-67787dfcbc75@redhat.com> Date: Wed, 6 Jul 2016 16:50:41 +0200 MIME-Version: 1.0 In-Reply-To: <1467732272-23368-11-git-send-email-clord@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kaLImV80xNdF6rvwiVi6nUu6JDKTBjeuS" Subject: Re: [Qemu-devel] [PATCH v3 10/32] blockdev: Move qcow2 probe to its own file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Colin Lord , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kaLImV80xNdF6rvwiVi6nUu6JDKTBjeuS From: Max Reitz To: Colin Lord , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org Message-ID: <763eeaa7-5906-78e1-7227-67787dfcbc75@redhat.com> Subject: Re: [PATCH v3 10/32] blockdev: Move qcow2 probe to its own file References: <1467732272-23368-1-git-send-email-clord@redhat.com> <1467732272-23368-11-git-send-email-clord@redhat.com> In-Reply-To: <1467732272-23368-11-git-send-email-clord@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 05.07.2016 17:24, Colin Lord wrote: > Isolates qcow2 probe as part of the modularization process. >=20 > Signed-off-by: Colin Lord > --- > block/Makefile.objs | 2 +- > block/probe/qcow2.c | 16 ++++++++++++++++ > block/qcow2.c | 13 +------------ > include/block/probe.h | 1 + > 4 files changed, 19 insertions(+), 13 deletions(-) > create mode 100644 block/probe/qcow2.c Reviewed-by: Max Reitz > diff --git a/block/probe/qcow2.c b/block/probe/qcow2.c > new file mode 100644 > index 0000000..56f4e82 > --- /dev/null > +++ b/block/probe/qcow2.c > @@ -0,0 +1,16 @@ > +#include "qemu/osdep.h" > +#include "block/block_int.h" > +#include "block/probe.h" > +#include "block/qcow2.h" > + > +int qcow2_probe(const uint8_t *buf, int buf_size, const char *filename= ) > +{ > + const QCowHeader *cow_header =3D (const void *)buf; > + > + if (buf_size >=3D sizeof(QCowHeader) && > + be32_to_cpu(cow_header->magic) =3D=3D QCOW_MAGIC && > + be32_to_cpu(cow_header->version) >=3D 2) > + return 100; > + else > + return 0; =2E..aaand even more of this... > +} --kaLImV80xNdF6rvwiVi6nUu6JDKTBjeuS 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 iQEvBAEBCAAZBQJXfRrBEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrTvH B/47ylhbgLF2ZccQRb2YPGxltrFx6lwCl5xgRFHxATNPNCAVpri63g5HA8DdVmfo 8Cq4lqEfxbGM8WzFlCnSuOTfNa3eB9iHv7O1wwSmvQnIhogzUrRmP/W1Lqqdo/TB EMPUngb/+4l4V9weeZa3Opi0HzDFLD0hfs9W3b6k/IVSvzGyhd+bIi3WtHguxZke VV9uRZ+WfGg9BRPFQ//ZI+CeZUFn4l6IHGl+Rv6G18FeRPsc/M2/H67TL4QXnXJS S44EXxTND9PKQGW40/Op/9zp2FWGdX4ecnJA3sYUaDs5D4xt4dUKE4mSATQV8cv1 pp2nJjWSC89qks9ghajNpUbN =s2S0 -----END PGP SIGNATURE----- --kaLImV80xNdF6rvwiVi6nUu6JDKTBjeuS--