Received: from eggs.gnu.org ([2001:4830:134:3::10]:47763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKo8h-0007dY-Hi for qemu-devel@nongnu.org; Wed, 06 Jul 2016 10:49:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKo8f-0000Hr-O4 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 10:49:22 -0400 References: <1467732272-23368-1-git-send-email-clord@redhat.com> <1467732272-23368-10-git-send-email-clord@redhat.com> From: Max Reitz Message-ID: <36c72a61-39c4-cb60-cb36-bb39c308dabb@redhat.com> Date: Wed, 6 Jul 2016 16:49:09 +0200 MIME-Version: 1.0 In-Reply-To: <1467732272-23368-10-git-send-email-clord@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PBf5osqdFQxLjhViBQbcvqa7OUMF9TFAU" Subject: Re: [Qemu-devel] [PATCH v3 09/32] blockdev: Move qcow 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) --PBf5osqdFQxLjhViBQbcvqa7OUMF9TFAU From: Max Reitz To: Colin Lord , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org Message-ID: <36c72a61-39c4-cb60-cb36-bb39c308dabb@redhat.com> Subject: Re: [PATCH v3 09/32] blockdev: Move qcow probe to its own file References: <1467732272-23368-1-git-send-email-clord@redhat.com> <1467732272-23368-10-git-send-email-clord@redhat.com> In-Reply-To: <1467732272-23368-10-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 qcow probe as part of the modularization process. >=20 > Signed-off-by: Colin Lord > --- > block/Makefile.objs | 2 +- > block/probe/qcow.c | 16 ++++++++++++++++ > block/qcow.c | 31 ++----------------------------- > include/block/driver/qcow.h | 21 +++++++++++++++++++++ > include/block/probe.h | 1 + > 5 files changed, 41 insertions(+), 30 deletions(-) > create mode 100644 block/probe/qcow.c > create mode 100644 include/block/driver/qcow.h Reviewed-by: Max Reitz > diff --git a/block/probe/qcow.c b/block/probe/qcow.c > new file mode 100644 > index 0000000..6024d11 > --- /dev/null > +++ b/block/probe/qcow.c > @@ -0,0 +1,16 @@ > +#include "qemu/osdep.h" > +#include "block/block_int.h" > +#include "block/probe.h" > +#include "block/driver/qcow.h" > + > +int qcow_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=3D QCOW_VERSION) > + return 100; > + else > + return 0; Again, pre-existing code style issues. > +} --PBf5osqdFQxLjhViBQbcvqa7OUMF9TFAU 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 iQEvBAEBCAAZBQJXfRplEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrQ9W B/kBlPQP/qDsoBq/f/KRYU4f6HfWqahzOrbJQ9a6jxVoZZ6X6txUOrxTjeC8WM4x C6Vmyk8hCOTyiLLw1Mg8H+L7zt/47KQJYcJBJUD5GV42PDOo29YkISu3O1iE2mP+ lG37/rQoYHUafMfXo0l54FMEVvbBa9YJN9JdoOLZeaCktNLmyZrNUr/x5wrQy6Uj NrvLXq4o+E3CHgymq8+HSc5fgaqAudGdeO/zCn0BncL3c3JNSeHk3hC0ECCbd8j7 kH/ZtS6WTODKGcnnORyTsmgzNQ40Gy3UoyTUdgSlDTyhCiD/Wyl4Y2NxP6XSS+BV 4zc1EwfX/j9bT0JMHi9VD4ck =l0dE -----END PGP SIGNATURE----- --PBf5osqdFQxLjhViBQbcvqa7OUMF9TFAU--