From nobody Thu Nov 6 08:26:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15397870200141014.4210407036951; Wed, 17 Oct 2018 07:37:00 -0700 (PDT) Received: from localhost ([::1]:37033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCmwR-0001Sj-3T for importer@patchew.org; Wed, 17 Oct 2018 10:36:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCmuJ-0000DB-6F for qemu-devel@nongnu.org; Wed, 17 Oct 2018 10:34:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCmuF-0006FJ-3R for qemu-devel@nongnu.org; Wed, 17 Oct 2018 10:34:43 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:48028) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCmuE-0005ou-BB; Wed, 17 Oct 2018 10:34:38 -0400 Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1gCmtt-0004Gn-9p; Wed, 17 Oct 2018 16:34:17 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1gCmtb-0003iZ-9r; Wed, 17 Oct 2018 17:33:59 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=LLoD6/cUM3YQA9qalTv0FsNk3cEb7CQSqfhELh7PCig=; b=K3nOJZeWi95qKifCMYCgd3z937Q/hFf/hrbPtsgUy0jluR6P2awGhN6r20BrmbrUfaL8dyCfyI0FGqt7d6qu4tA5TFdoM8PjZ4Kpp8hdHYcrp5Q0Uzd1mLHUWd2QcYLZbp0pj6bdGS5smQ1JKlvKYNUX6KeqntmRBPQs03/JioaDNNbMzlkRVY5vbEqsoMxb47p6ndRvhsp5PAwxvCOtKY+6x1LDHZ3D3BgaWNzqiagIl4xo4nphTw0S0p/WKQrAnL5sqxM04EnKUF8bkqR0jUO3QSUcFrEFuCoK3TLpREjBcGytaY61s07Xw1GS/YbsZwHwma7LywD7BnoDaIgUXA==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 17 Oct 2018 17:33:49 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH 1/3] quorum: Remove quorum_err() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , Markus Armbruster , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reported-by: Markus Armbruster --- block/quorum.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/block/quorum.c b/block/quorum.c index eb526cc0f1..b1b777baef 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -437,23 +437,7 @@ static bool quorum_iovec_compare(QEMUIOVector *a, QEMU= IOVector *b) return true; } =20 -static void GCC_FMT_ATTR(2, 3) quorum_err(QuorumAIOCB *acb, - const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - fprintf(stderr, "quorum: offset=3D%" PRIu64 " bytes=3D%" 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) +static bool quorum_compare(QuorumAIOCB *acb, QEMUIOVector *a, QEMUIOVector= *b) { BDRVQuorumState *s =3D acb->bs->opaque; ssize_t offset; @@ -462,8 +446,10 @@ static bool quorum_compare(QuorumAIOCB *acb, if (s->is_blkverify) { offset =3D qemu_iovec_compare(a, b); if (offset !=3D -1) { - quorum_err(acb, "contents mismatch at offset %" PRIu64, - acb->offset + offset); + fprintf(stderr, "quorum: offset=3D%" PRIu64 " bytes=3D%" PRIu64 + " contents mismatch at offset %" PRIu64 "\n", + acb->offset, acb->bytes, acb->offset + offset); + exit(1); } return true; } --=20 2.11.0