From patchwork Wed Nov 2 16:50:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasanna Kumar Kalever X-Patchwork-Id: 9409519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7DA9860721 for ; Wed, 2 Nov 2016 16:51:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F2822A23B for ; Wed, 2 Nov 2016 16:51:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 634372A332; Wed, 2 Nov 2016 16:51:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 03A202A23B for ; Wed, 2 Nov 2016 16:51:46 +0000 (UTC) Received: from localhost ([::1]:56421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1ylN-0005Pl-6v for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Nov 2016 12:51:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1ykl-0005N0-Kh for qemu-devel@nongnu.org; Wed, 02 Nov 2016 12:51:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1ykh-0008IT-Mw for qemu-devel@nongnu.org; Wed, 02 Nov 2016 12:51:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52446) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c1ykh-0008I7-FH for qemu-devel@nongnu.org; Wed, 02 Nov 2016 12:51:03 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEF157EBCB for ; Wed, 2 Nov 2016 16:51:02 +0000 (UTC) Received: from localhost.localdomain.com (vpn1-6-176.sin2.redhat.com [10.67.6.176]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uA2Goi0l014238; Wed, 2 Nov 2016 12:50:57 -0400 From: Prasanna Kumar Kalever To: qemu-devel@nongnu.org Date: Wed, 2 Nov 2016 22:20:36 +0530 Message-Id: <1478105438-20883-2-git-send-email-prasanna.kalever@redhat.com> In-Reply-To: <1478105438-20883-1-git-send-email-prasanna.kalever@redhat.com> References: <1478105438-20883-1-git-send-email-prasanna.kalever@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 02 Nov 2016 16:51:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 1/3] block/gluster: fix QMP to match debug option 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: Prasanna Kumar Kalever , jcody@redhat.com, vbellur@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The QMP definition of BlockdevOptionsGluster: { 'struct': 'BlockdevOptionsGluster', 'data': { 'volume': 'str', 'path': 'str', 'server': ['GlusterServer'], '*debug-level': 'int', '*logfile': 'str' } } But instead of 'debug-level we have exported 'debug' as the option for choosing debug level of gluster protocol driver. This patch fix QMP definition BlockdevOptionsGluster s/debug-level/debug/ Suggested-by: Eric Blake Signed-off-by: Prasanna Kumar Kalever Reviewed-by: Eric Blake --- block/gluster.c | 34 +++++++++++++++++----------------- qapi/block-core.json | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index 0ce15f7..e23dc3b 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -48,7 +48,7 @@ typedef struct BDRVGlusterState { struct glfs_fd *fd; char *logfile; bool supports_seek_data; - int debug_level; + int debug; } BDRVGlusterState; typedef struct BDRVGlusterReopenState { @@ -433,7 +433,7 @@ static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf, } } - ret = glfs_set_logging(glfs, gconf->logfile, gconf->debug_level); + ret = glfs_set_logging(glfs, gconf->logfile, gconf->debug); if (ret < 0) { goto out; } @@ -787,17 +787,17 @@ static int qemu_gluster_open(BlockDriverState *bs, QDict *options, filename = qemu_opt_get(opts, GLUSTER_OPT_FILENAME); - s->debug_level = qemu_opt_get_number(opts, GLUSTER_OPT_DEBUG, + s->debug = qemu_opt_get_number(opts, GLUSTER_OPT_DEBUG, GLUSTER_DEBUG_DEFAULT); - if (s->debug_level < 0) { - s->debug_level = 0; - } else if (s->debug_level > GLUSTER_DEBUG_MAX) { - s->debug_level = GLUSTER_DEBUG_MAX; + if (s->debug < 0) { + s->debug = 0; + } else if (s->debug > GLUSTER_DEBUG_MAX) { + s->debug = GLUSTER_DEBUG_MAX; } gconf = g_new0(BlockdevOptionsGluster, 1); - gconf->debug_level = s->debug_level; - gconf->has_debug_level = true; + gconf->debug = s->debug; + gconf->has_debug = true; logfile = qemu_opt_get(opts, GLUSTER_OPT_LOGFILE); s->logfile = g_strdup(logfile ? logfile : GLUSTER_LOGFILE_DEFAULT); @@ -873,8 +873,8 @@ static int qemu_gluster_reopen_prepare(BDRVReopenState *state, qemu_gluster_parse_flags(state->flags, &open_flags); gconf = g_new0(BlockdevOptionsGluster, 1); - gconf->debug_level = s->debug_level; - gconf->has_debug_level = true; + gconf->debug = s->debug; + gconf->has_debug = true; gconf->logfile = g_strdup(s->logfile); gconf->has_logfile = true; reop_s->glfs = qemu_gluster_init(gconf, state->bs->filename, NULL, errp); @@ -1010,14 +1010,14 @@ static int qemu_gluster_create(const char *filename, char *tmp = NULL; gconf = g_new0(BlockdevOptionsGluster, 1); - gconf->debug_level = qemu_opt_get_number_del(opts, GLUSTER_OPT_DEBUG, + gconf->debug = qemu_opt_get_number_del(opts, GLUSTER_OPT_DEBUG, GLUSTER_DEBUG_DEFAULT); - if (gconf->debug_level < 0) { - gconf->debug_level = 0; - } else if (gconf->debug_level > GLUSTER_DEBUG_MAX) { - gconf->debug_level = GLUSTER_DEBUG_MAX; + if (gconf->debug < 0) { + gconf->debug = 0; + } else if (gconf->debug > GLUSTER_DEBUG_MAX) { + gconf->debug = GLUSTER_DEBUG_MAX; } - gconf->has_debug_level = true; + gconf->has_debug = true; gconf->logfile = qemu_opt_get_del(opts, GLUSTER_OPT_LOGFILE); if (!gconf->logfile) { diff --git a/qapi/block-core.json b/qapi/block-core.json index bcd3b9e..a569cfb 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2195,7 +2195,7 @@ # # @server: gluster servers description # -# @debug-level: #optional libgfapi log level (default '4' which is Error) +# @debug: #optional libgfapi log level (default '4' which is Error) # # @logfile: #optional libgfapi log file (default /dev/stderr) (Since 2.8) # @@ -2205,7 +2205,7 @@ 'data': { 'volume': 'str', 'path': 'str', 'server': ['GlusterServer'], - '*debug-level': 'int', + '*debug': 'int', '*logfile': 'str' } } ##