quorum: Remove quorum_err()
This is a static function with only one caller, so there's no need to keep it. Inlining the code in quorum_compare() makes it much simpler. Signed-off-by: Alberto Garcia <berto@igalia.com> Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
091901841a
commit
6840e8d8ae
|
@ -437,23 +437,7 @@ static bool quorum_iovec_compare(QEMUIOVector *a, QEMUIOVector *b)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void GCC_FMT_ATTR(2, 3) quorum_err(QuorumAIOCB *acb,
|
static bool quorum_compare(QuorumAIOCB *acb, QEMUIOVector *a, QEMUIOVector *b)
|
||||||
const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
|
||||||
fprintf(stderr, "quorum: offset=%" PRIu64 " bytes=%" PRIu64 " ",
|
|
||||||
acb->offset, acb->bytes);
|
|
||||||
vfprintf(stderr, fmt, ap);
|
|
||||||
fprintf(stderr, "\n");
|
|
||||||
va_end(ap);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool quorum_compare(QuorumAIOCB *acb,
|
|
||||||
QEMUIOVector *a,
|
|
||||||
QEMUIOVector *b)
|
|
||||||
{
|
{
|
||||||
BDRVQuorumState *s = acb->bs->opaque;
|
BDRVQuorumState *s = acb->bs->opaque;
|
||||||
ssize_t offset;
|
ssize_t offset;
|
||||||
|
@ -462,8 +446,10 @@ static bool quorum_compare(QuorumAIOCB *acb,
|
||||||
if (s->is_blkverify) {
|
if (s->is_blkverify) {
|
||||||
offset = qemu_iovec_compare(a, b);
|
offset = qemu_iovec_compare(a, b);
|
||||||
if (offset != -1) {
|
if (offset != -1) {
|
||||||
quorum_err(acb, "contents mismatch at offset %" PRIu64,
|
fprintf(stderr, "quorum: offset=%" PRIu64 " bytes=%" PRIu64
|
||||||
acb->offset + offset);
|
" contents mismatch at offset %" PRIu64 "\n",
|
||||||
|
acb->offset, acb->bytes, acb->offset + offset);
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue