All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: don't register quorum driver if SHA256 support is unavailable
@ 2015-08-04 14:48 Sascha Silbe
  2015-08-04 16:31 ` [Qemu-devel] [PATCH for-2.4] " Eric Blake
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Sascha Silbe @ 2015-08-04 14:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Alberto Garcia, qemu-block

Commit 488981a4 [block: convert quorum blockdrv to use crypto APIs]
broke qemu-iotest 041 on hosts with GnuTLS < 2.10.0. It converted a
compile-time check to a run-time check at device open time. The result
is that we now advertise a feature (the quorum block driver) that will
never work (on those hosts). There's no way (short of parsing
human-readable error messages) for qemu-iotests or any other API
consumer to recognise that the quorum block driver isn't _actually_
available and shouldn't be used or tested.

Move the run-time check to bdrv_quorum_init() to avoid registering the
quorum block driver if we know it cannot work. This way API consumers
can recognise it's unavailable.

Fixes: 488981a4af396551a3178d032cc2b41d9553ada2
Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
---
 block/quorum.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/block/quorum.c b/block/quorum.c
index 4e66221..2f6c45f 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -865,12 +865,6 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
     int i;
     int ret = 0;
 
-    if (!qcrypto_hash_supports(QCRYPTO_HASH_ALG_SHA256)) {
-        error_setg(errp,
-                   "SHA256 hash support is required for quorum device");
-        return -EINVAL;
-    }
-
     qdict_flatten(options);
 
     /* count how many different children are present */
@@ -1061,6 +1055,10 @@ 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);
 }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.4] block: don't register quorum driver if SHA256 support is unavailable
  2015-08-04 14:48 [Qemu-devel] [PATCH] block: don't register quorum driver if SHA256 support is unavailable Sascha Silbe
@ 2015-08-04 16:31 ` Eric Blake
  2015-08-05  9:03 ` [Qemu-devel] [PATCH] " Alberto Garcia
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Eric Blake @ 2015-08-04 16:31 UTC (permalink / raw)
  To: Sascha Silbe, qemu-devel; +Cc: Kevin Wolf, Alberto Garcia, qemu-block

[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]

On 08/04/2015 08:48 AM, Sascha Silbe wrote:
> Commit 488981a4 [block: convert quorum blockdrv to use crypto APIs]
> broke qemu-iotest 041 on hosts with GnuTLS < 2.10.0. It converted a
> compile-time check to a run-time check at device open time. The result
> is that we now advertise a feature (the quorum block driver) that will
> never work (on those hosts). There's no way (short of parsing
> human-readable error messages) for qemu-iotests or any other API
> consumer to recognise that the quorum block driver isn't _actually_
> available and shouldn't be used or tested.
> 
> Move the run-time check to bdrv_quorum_init() to avoid registering the
> quorum block driver if we know it cannot work. This way API consumers
> can recognise it's unavailable.
> 
> Fixes: 488981a4af396551a3178d032cc2b41d9553ada2
> Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
> ---
>  block/quorum.c |   10 ++++------
>  1 files changed, 4 insertions(+), 6 deletions(-)

Sounds like this is a regression fix, and therefore suitable for hard
freeze.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] block: don't register quorum driver if SHA256 support is unavailable
  2015-08-04 14:48 [Qemu-devel] [PATCH] block: don't register quorum driver if SHA256 support is unavailable Sascha Silbe
  2015-08-04 16:31 ` [Qemu-devel] [PATCH for-2.4] " Eric Blake
@ 2015-08-05  9:03 ` Alberto Garcia
  2015-08-05  9:06 ` Daniel P. Berrange
  2015-08-05 14:28 ` Peter Maydell
  3 siblings, 0 replies; 6+ messages in thread
From: Alberto Garcia @ 2015-08-05  9:03 UTC (permalink / raw)
  To: Sascha Silbe, qemu-devel; +Cc: Kevin Wolf, qemu-block

> Move the run-time check to bdrv_quorum_init() to avoid registering the
> quorum block driver if we know it cannot work. This way API consumers
> can recognise it's unavailable.
>
> Fixes: 488981a4af396551a3178d032cc2b41d9553ada2
> Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] block: don't register quorum driver if SHA256 support is unavailable
  2015-08-04 14:48 [Qemu-devel] [PATCH] block: don't register quorum driver if SHA256 support is unavailable Sascha Silbe
  2015-08-04 16:31 ` [Qemu-devel] [PATCH for-2.4] " Eric Blake
  2015-08-05  9:03 ` [Qemu-devel] [PATCH] " Alberto Garcia
@ 2015-08-05  9:06 ` Daniel P. Berrange
  2015-08-05 14:28 ` Peter Maydell
  3 siblings, 0 replies; 6+ messages in thread
From: Daniel P. Berrange @ 2015-08-05  9:06 UTC (permalink / raw)
  To: Sascha Silbe; +Cc: Kevin Wolf, Alberto Garcia, qemu-devel, qemu-block

On Tue, Aug 04, 2015 at 04:48:25PM +0200, Sascha Silbe wrote:
> Commit 488981a4 [block: convert quorum blockdrv to use crypto APIs]
> broke qemu-iotest 041 on hosts with GnuTLS < 2.10.0. It converted a
> compile-time check to a run-time check at device open time. The result
> is that we now advertise a feature (the quorum block driver) that will
> never work (on those hosts). There's no way (short of parsing
> human-readable error messages) for qemu-iotests or any other API
> consumer to recognise that the quorum block driver isn't _actually_
> available and shouldn't be used or tested.
> 
> Move the run-time check to bdrv_quorum_init() to avoid registering the
> quorum block driver if we know it cannot work. This way API consumers
> can recognise it's unavailable.
> 
> Fixes: 488981a4af396551a3178d032cc2b41d9553ada2
> Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] block: don't register quorum driver if SHA256 support is unavailable
  2015-08-04 14:48 [Qemu-devel] [PATCH] block: don't register quorum driver if SHA256 support is unavailable Sascha Silbe
                   ` (2 preceding siblings ...)
  2015-08-05  9:06 ` Daniel P. Berrange
@ 2015-08-05 14:28 ` Peter Maydell
  2015-08-05 19:04   ` Sascha Silbe
  3 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2015-08-05 14:28 UTC (permalink / raw)
  To: Sascha Silbe; +Cc: Kevin Wolf, Alberto Garcia, QEMU Developers, Qemu-block

On 4 August 2015 at 15:48, Sascha Silbe <silbe@linux.vnet.ibm.com> wrote:
> Commit 488981a4 [block: convert quorum blockdrv to use crypto APIs]
> broke qemu-iotest 041 on hosts with GnuTLS < 2.10.0. It converted a
> compile-time check to a run-time check at device open time. The result
> is that we now advertise a feature (the quorum block driver) that will
> never work (on those hosts). There's no way (short of parsing
> human-readable error messages) for qemu-iotests or any other API
> consumer to recognise that the quorum block driver isn't _actually_
> available and shouldn't be used or tested.
>
> Move the run-time check to bdrv_quorum_init() to avoid registering the
> quorum block driver if we know it cannot work. This way API consumers
> can recognise it's unavailable.
>
> Fixes: 488981a4af396551a3178d032cc2b41d9553ada2
> Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>

Applied to master, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] block: don't register quorum driver if SHA256 support is unavailable
  2015-08-05 14:28 ` Peter Maydell
@ 2015-08-05 19:04   ` Sascha Silbe
  0 siblings, 0 replies; 6+ messages in thread
From: Sascha Silbe @ 2015-08-05 19:04 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Kevin Wolf, Alberto Garcia, QEMU Developers, Qemu-block

Dear Peter,

Peter Maydell <peter.maydell@linaro.org> writes:

> Applied to master, thanks.

Thanks everyone for the fast reviews and inclusion!

Sascha
-- 
Softwareentwicklung Sascha Silbe, Niederhofenstraße 5/1, 71229 Leonberg
https://se-silbe.de/
USt-IdNr. DE281696641

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-05 19:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-04 14:48 [Qemu-devel] [PATCH] block: don't register quorum driver if SHA256 support is unavailable Sascha Silbe
2015-08-04 16:31 ` [Qemu-devel] [PATCH for-2.4] " Eric Blake
2015-08-05  9:03 ` [Qemu-devel] [PATCH] " Alberto Garcia
2015-08-05  9:06 ` Daniel P. Berrange
2015-08-05 14:28 ` Peter Maydell
2015-08-05 19:04   ` Sascha Silbe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.