Received: from eggs.gnu.org ([2001:4830:134:3::10]:58264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPBP0-0003SN-Oh for qemu-devel@nongnu.org; Mon, 18 Jul 2016 12:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPBOy-0003NA-PA for qemu-devel@nongnu.org; Mon, 18 Jul 2016 12:28:17 -0400 References: <1468523008-30013-1-git-send-email-clord@redhat.com> <1468523008-30013-18-git-send-email-clord@redhat.com> From: Max Reitz Message-ID: <237db15c-fb0a-4080-9d25-91260012bdaa@redhat.com> Date: Mon, 18 Jul 2016 18:28:07 +0200 MIME-Version: 1.0 In-Reply-To: <1468523008-30013-18-git-send-email-clord@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vTnNIwqO0Up9WADDrRa0J7hiUTfHwnoiq" Subject: Re: [Qemu-devel] [PATCH v4 17/32] blockdev: Separate bochs probe from its driver 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) --vTnNIwqO0Up9WADDrRa0J7hiUTfHwnoiq From: Max Reitz To: Colin Lord , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org Message-ID: <237db15c-fb0a-4080-9d25-91260012bdaa@redhat.com> Subject: Re: [PATCH v4 17/32] blockdev: Separate bochs probe from its driver References: <1468523008-30013-1-git-send-email-clord@redhat.com> <1468523008-30013-18-git-send-email-clord@redhat.com> In-Reply-To: <1468523008-30013-18-git-send-email-clord@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 14.07.2016 21:03, Colin Lord wrote: > Modifies the bochs probe to return the format name as well as the > score as the final step of separating the probe function from the > driver. This keeps the probe completely independent of the driver, > making future modularization easier to accomplish. Returning the format= > name as well as the score allows the score to be correlated to the > driver without the probe function needing to be part of the driver. >=20 > Signed-off-by: Colin Lord > --- > block.c | 20 ++++++++++++++++++++ > block/bochs-probe.c | 25 ++++++++++++++++--------- > block/bochs.c | 1 - > include/block/probe.h | 3 ++- > 4 files changed, 38 insertions(+), 11 deletions(-) >=20 > diff --git a/block.c b/block.c > index 3a0dc19..b16f8cf 100644 > --- a/block.c > +++ b/block.c > @@ -25,6 +25,7 @@ > #include "trace.h" > #include "block/block_int.h" > #include "block/blockjob.h" > +#include "block/probe.h" > #include "qemu/error-report.h" > #include "module_block.h" > #include "qemu/module.h" > @@ -56,6 +57,13 @@ > =20 > #define NOT_DONE 0x7fffffff /* used while emulated sync operation in p= rogress */ > =20 > +typedef const char *BdrvProbeFunc(const uint8_t *buf, int buf_size, > + const char *filename, int *score); > + > +static BdrvProbeFunc *format_probes[] =3D { > + bdrv_bochs_probe, > +}; > + I really can't convince you of my "struct concept", can I? :-) Unless maybe I can: Reviewed-by: Max Reitz --vTnNIwqO0Up9WADDrRa0J7hiUTfHwnoiq 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 iQEvBAEBCAAZBQJXjQOXEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrY2Z B/4xmZAVeqNUVnocArOrpEnyBUjmp65poRJ3lkXWLxX8abmcWsIYdBlsXcERjkkk Xi29TOzkUw7SulyzwHfWPCGlK2HRaQBKksht3oijbz9GBDwpCLHXN5EF1RHciRr9 vlHOBDMqFPiyZPSQS9RqIOLxN+feDXgLSN8HP9+YKqHyX1U2Ca2hAgiOWZLEneqP QblqIBZ2FrrudJYH7rIdS7pVYoQl2SMe10R8PYPBkblAMtYnPAbIy4Qs1eaDMBvD HxfU3bFI4sSHZQltgu3lBsZ2QW2dCLY1vzRFq1IK53Pi47Q5aRq13SRhk93W+TrW KGSXRbuCQKKtXqq0Ww2mqI0i =w4Yd -----END PGP SIGNATURE----- --vTnNIwqO0Up9WADDrRa0J7hiUTfHwnoiq--