From patchwork Wed Mar 9 16:11:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 8547341 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 11905C0553 for ; Wed, 9 Mar 2016 16:12:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DEFD20295 for ; Wed, 9 Mar 2016 16:12:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E91812015E for ; Wed, 9 Mar 2016 16:12:09 +0000 (UTC) Received: from localhost ([::1]:42343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adgiX-0007Cw-8e for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Mar 2016 11:12:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adgiF-00077g-Uu for qemu-devel@nongnu.org; Wed, 09 Mar 2016 11:11:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adgi9-0006L0-Rk for qemu-devel@nongnu.org; Wed, 09 Mar 2016 11:11:51 -0500 Received: from smtp3.mundo-r.com ([212.51.32.191]:5676 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adgi9-0006K6-Ku; Wed, 09 Mar 2016 11:11:45 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CbBAA1SuBW/5tjdVteGQEBAg8BAQEBgwuBP6ZpAQEBAQEBBQGBDwGQPIITAQ2BbYYPAoFIOBQBAQEBAQEBZCdBEgGDbgEBBCdSED8SPBsZiCgBv2sBAQEHIIVQgkOHTYNuBY0xigaNcokrhVFEjhoeAQFCggIBGRSBNmiHV4F8AQEB X-IPAS-Result: A2CbBAA1SuBW/5tjdVteGQEBAg8BAQEBgwuBP6ZpAQEBAQEBBQGBDwGQPIITAQ2BbYYPAoFIOBQBAQEBAQEBZCdBEgGDbgEBBCdSED8SPBsZiCgBv2sBAQEHIIVQgkOHTYNuBY0xigaNcokrhVFEjhoeAQFCggIBGRSBNmiHV4F8AQEB X-IronPort-AV: E=Sophos;i="5.24,311,1454972400"; d="scan'208";a="95720083" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 09 Mar 2016 17:11:42 +0100 Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim) id 1adgi5-0007l9-SS; Wed, 09 Mar 2016 17:11:42 +0100 Received: from berto by perseus.local with local (Exim 4.86_2) (envelope-from ) id 1adghp-00070m-7s; Wed, 09 Mar 2016 18:11:25 +0200 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 9 Mar 2016 18:11:19 +0200 Message-Id: <86d17a2e18327c7dfd43b9644d2f51e3a7980a13.1457539274.git.berto@igalia.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.51.32.191 Cc: Alberto Garcia , qemu-block@nongnu.org Subject: [Qemu-devel] [PATCH 2/4] monitor: Separate QUORUM_REPORT_BAD events according to the node name X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The QUORUM_REPORT_BAD event is emitted whenever there's an I/O error in a child of a Quorum device. This event is emitted at a maximum rate of 1 per second. This means that an error in one of the children will mask errors in the other children if they happen within the same 1 second interval. This patch modifies qapi_event_throttle_equal() so QUORUM_REPORT_BAD events are kept separately if they come from different children. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- monitor.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/monitor.c b/monitor.c index e99ca8c..c9fe862 100644 --- a/monitor.c +++ b/monitor.c @@ -572,6 +572,10 @@ static unsigned int qapi_event_throttle_hash(const void *key) hash += g_str_hash(qdict_get_str(evstate->data, "id")); } + if (evstate->event == QAPI_EVENT_QUORUM_REPORT_BAD) { + hash += g_str_hash(qdict_get_str(evstate->data, "node-name")); + } + return hash; } @@ -589,6 +593,11 @@ static gboolean qapi_event_throttle_equal(const void *a, const void *b) qdict_get_str(evb->data, "id")); } + if (eva->event == QAPI_EVENT_QUORUM_REPORT_BAD) { + return !strcmp(qdict_get_str(eva->data, "node-name"), + qdict_get_str(evb->data, "node-name")); + } + return TRUE; }