qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: "Benoît Canet" <benoit.canet@irqsave.net>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [RFC V8 06/13] quorum: Add quorum mechanism.
Date: Fri, 27 Sep 2013 12:05:26 +0200	[thread overview]
Message-ID: <20130927100526.GJ2440@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <20130926164630.GF3338@irqsave.net>

Am 26.09.2013 um 18:46 hat Benoît Canet geschrieben:
> Le Friday 08 Feb 2013 à 13:07:03 (+0100), Kevin Wolf a écrit :
> > Am 28.01.2013 18:07, schrieb Benoît Canet:
> > > Use gnutls's SHA-256 to compare versions.
> > > 
> > > Signed-off-by: Benoit Canet <benoit@irqsave.net>
> > > ---
> > >  block/quorum.c |  303 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> > >  configure      |   22 ++++
> > >  2 files changed, 324 insertions(+), 1 deletion(-)

> > > +static bool quorum_iovec_compare(QEMUIOVector *a, QEMUIOVector *b)
> > > +{
> > > +    int i;
> > > +    int result;
> > > +
> > > +    assert(a->niov == b->niov);
> > > +    for (i = 0; i < a->niov; i++) {
> > > +        assert(a->iov[i].iov_len == b->iov[i].iov_len);
> > > +        result = memcmp(a->iov[i].iov_base,
> > > +                        b->iov[i].iov_base,
> > > +                        a->iov[i].iov_len);
> > > +        if (result) {
> > > +            return false;
> > > +        }
> > > +    }
> > > +
> > > +    return true;
> > > +}
> > 
> > qemu_iovec_compare() seems to do exactly the same, except that this
> > doesn't return the offset of the first difference.
> > 
> > Why is it a good idea to duplicate the code?
> 
> Quorum need speed: qemu_iovec_compare will do byte level comparison whereas
> memcmp will use SSE on large block.

Fair enough.

> > > +    /* we have a winner: copy it */
> > > +    quorum_copy_qiov(acb->qiov, &acb->aios[winner->index].qiov);
> > > +
> > > +    /* some versions are bad print them */
> > > +    quorum_print_bad_versions(acb, &winner->value);
> > 
> > Same here. Is this driver meant to be used in production or only for
> > debugging? Maybe it should have a debug mode that must explicitly be
> > enabled and messages are only printed in this mode?
> 
> Quorum needs to communicate some event to the user for maintainance.
> Would thowing QMP events be better ?

Yes, absolutely. Error messages on stderr end up in a log file at best
and can only be read by human administrators. Using QMP enables
management tools to take action.

Kevin

  reply	other threads:[~2013-09-27 10:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1359392845-15905-1-git-send-email-benoit@irqsave.net>
     [not found] ` <1359392845-15905-4-git-send-email-benoit@irqsave.net>
     [not found]   ` <5114D5AE.6070901@redhat.com>
2013-09-26 15:25     ` [Qemu-devel] [RFC V8 03/13] quorum: Add quorum_aio_writev and its dependencies Benoît Canet
2013-09-26 16:16     ` Benoît Canet
2013-09-27  9:59       ` Kevin Wolf
2013-09-26 16:29     ` Benoît Canet
2013-09-27 10:03       ` Kevin Wolf
2013-09-30 12:54         ` Benoît Canet
     [not found] ` <1359392845-15905-7-git-send-email-benoit@irqsave.net>
     [not found]   ` <5114EA67.5000308@redhat.com>
2013-09-26 16:46     ` [Qemu-devel] [RFC V8 06/13] quorum: Add quorum mechanism Benoît Canet
2013-09-27 10:05       ` Kevin Wolf [this message]
2013-09-30 12:58     ` Benoît Canet

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=20130927100526.GJ2440@dhcp-200-207.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=benoit.canet@irqsave.net \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).