qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Alberto Garcia <berto@igalia.com>,
	qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] quorum: Only compile when supported
Date: Wed, 6 Jul 2016 08:56:33 +0800	[thread overview]
Message-ID: <20160706005633.GC13849@ad.usersys.redhat.com> (raw)
In-Reply-To: <20160705093544.GF6553@redhat.com>

On Tue, 07/05 10:35, Daniel P. Berrange wrote:
> 
> Can you backup and explain more detail what the actual problem you're trying
> to solve is. IIUC, it is related to module loading, but I'm not seeing exactly
> what it is.

This patch originated when I was researching all drivers' block_init functions
about module loading, and realized this is the only one "runtime check" and is
poorly established as it's actually "static". The unnecessity is more of the
reason behind the patch.

Its relationship with module loading is, it makes implementing this idea
easier:

https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg07580.html

> Surely when we load the quorum.so module, we'll just invoke the
> bdrv_quorum_init() method as normal, so I would have expected the current
> logic to continue to "just work".  ie, just because we load a module, does
> not mean that module should be required to register its block driver.

You are right, module init function can do anything it wants, as long as we
really need it to. It's just not clear to me quorum is the case.

BTW thanks for sending the reverting series!

> 
> The other alternative though is to simply remove the hash check from the
> init method *and* unconditionally compile it, and simply allow the
> quorum_open() method do the qcrypto_hash_supports() check. This would
> be the same way that the LUKS block driver works - it has many crypto
> algorithms in use, chosen dynamically, so it has no choice but to test
> this at open() time.

This sounds good too.

Fam

> 
> > > > 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);
> > > >  }
> 
> 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 :|

  reply	other threads:[~2016-07-06  0:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28  1:47 [Qemu-devel] [PATCH] quorum: Only compile when supported Fam Zheng
2016-06-28  8:17 ` Alberto Garcia
2016-07-02 12:36 ` Max Reitz
2016-07-04 11:43   ` Alberto Garcia
2016-07-05  7:03   ` Fam Zheng
2016-07-05  7:58 ` Sascha Silbe
2016-07-05  8:11   ` Fam Zheng
2016-07-05  8:20   ` Alberto Garcia
2016-07-05  9:15     ` Sascha Silbe
2016-07-05  8:45 ` Daniel P. Berrange
2016-07-05  8:57   ` Fam Zheng
2016-07-05  9:35     ` Daniel P. Berrange
2016-07-06  0:56       ` Fam Zheng [this message]
2016-07-05  9:18   ` Alberto Garcia
2016-07-05  9:26     ` Daniel P. Berrange
2016-07-05 10:05       ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160706005633.GC13849@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=berrange@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).