[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH] quorum: Only compile when supported
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH] quorum: Only compile when supported |
Date: |
Sat, 2 Jul 2016 14:36:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 |
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.
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> block/Makefile.objs | 2 +-
> block/quorum.c | 4 ----
> 2 files changed, 1 insertion(+), 5 deletions(-)
>
> 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 += qcow2.o qcow2-refcount.o qcow2-cluster.o
> qcow2-snapshot.o qcow2-c
> block-obj-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o
> block-obj-y += qed-check.o
> block-obj-$(CONFIG_VHDX) += vhdx.o vhdx-endian.o vhdx-log.o
> -block-obj-y += quorum.o
> +block-obj-$(CONFIG_GNUTLS_HASH) += quorum.o
> block-obj-y += parallels.o blkdebug.o blkverify.o blkreplay.o
> block-obj-y += block-backend.o snapshot.o qapi.o
> block-obj-$(CONFIG_WIN32) += 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 = {
>
> 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);
> }
>
>
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [PATCH] quorum: Only compile when supported,
Max Reitz <=