From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJKAG-0003lX-4n for qemu-devel@nongnu.org; Sat, 02 Jul 2016 08:36:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJKAE-0006z8-3E for qemu-devel@nongnu.org; Sat, 02 Jul 2016 08:36:51 -0400 References: <20160628014747.20971-1-famz@redhat.com> From: Max Reitz Message-ID: Date: Sat, 2 Jul 2016 14:36:38 +0200 MIME-Version: 1.0 In-Reply-To: <20160628014747.20971-1-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LojLKCleO8w7Wmp7tQUuHR3JMmhnUm4lm" Subject: Re: [Qemu-devel] [PATCH] quorum: Only compile when supported List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LojLKCleO8w7Wmp7tQUuHR3JMmhnUm4lm From: Max Reitz To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org Message-ID: Subject: Re: [PATCH] quorum: Only compile when supported References: <20160628014747.20971-1-famz@redhat.com> In-Reply-To: <20160628014747.20971-1-famz@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 28.06.2016 03:47, Fam Zheng wrote: > This was the only exceptional module init function that does something > else than a simple list of bdrv_register() calls, in all the block > drivers. This sounds like this patch specifically wants to drop the check from bdrv_quorum_init(). I think keeping the check would be better; while we can probably assume that SHA256 is supported if CONFIG_GNUTLS_HASH is defined, it would still technically be better to actually check for that support. However, since this is probably only a theoretical issue, if there's a good reason (like preparation for dynamic block driver modules) for having to drop the check from bdrv_quorum_init(), I think it's alright to do so. Max > The qcrypto_hash_supports is actually a static check, determined at > compile time. Follow the block-job-$(CONFIG_FOO) convention for > consistency. >=20 > Signed-off-by: Fam Zheng > --- > block/Makefile.objs | 2 +- > block/quorum.c | 4 ---- > 2 files changed, 1 insertion(+), 5 deletions(-) >=20 > diff --git a/block/Makefile.objs b/block/Makefile.objs > index 44a5416..c87d605 100644 > --- a/block/Makefile.objs > +++ b/block/Makefile.objs > @@ -3,7 +3,7 @@ block-obj-y +=3D qcow2.o qcow2-refcount.o qcow2-cluster= =2Eo qcow2-snapshot.o qcow2-c > block-obj-y +=3D qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-clus= ter.o > block-obj-y +=3D qed-check.o > block-obj-$(CONFIG_VHDX) +=3D vhdx.o vhdx-endian.o vhdx-log.o > -block-obj-y +=3D quorum.o > +block-obj-$(CONFIG_GNUTLS_HASH) +=3D quorum.o > block-obj-y +=3D parallels.o blkdebug.o blkverify.o blkreplay.o > block-obj-y +=3D block-backend.o snapshot.o qapi.o > block-obj-$(CONFIG_WIN32) +=3D raw-win32.o win32-aio.o > diff --git a/block/quorum.c b/block/quorum.c > index 331b726..18fbed8 100644 > --- a/block/quorum.c > +++ b/block/quorum.c > @@ -1113,10 +1113,6 @@ static BlockDriver bdrv_quorum =3D { > =20 > static void bdrv_quorum_init(void) > { > - if (!qcrypto_hash_supports(QCRYPTO_HASH_ALG_SHA256)) { > - /* SHA256 hash support is required for quorum device */ > - return; > - } > bdrv_register(&bdrv_quorum); > } > =20 >=20 --LojLKCleO8w7Wmp7tQUuHR3JMmhnUm4lm 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 iQEvBAEBCAAZBQJXd7VWEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrVUj CACFBFq8/unIW612fJKp9gdgGoV59DVqkJrtHiZgwUi2hUK5L0FuZPjLhkDQUDeV xXO0Wzq07XBTKK8oMbe/dlJuKKd/X6S6WmI08seCBgNZjGMLvNAKl4oXAnA4BaUP 0ZEVY1V/inxrOWzdvSCIZ852a0iYL0cK113U1DQrrQnZ7rJdUMrlsu3YGDYUTyw3 gqBDjCQFElW7pFMN5MR5X42y23cjB+m3WZ7WWMqIO3uIEODKSN5dmXldWeUkreL6 qDe1JZoejbUkOJhdmMzNRTi1qDSWWqK9aVlmrmAv0SymUrhVddt90oGvHuyLDE4R fQ0x5rbiQ+jz4CguN4xm2+2w =BqD/ -----END PGP SIGNATURE----- --LojLKCleO8w7Wmp7tQUuHR3JMmhnUm4lm--