From patchwork Fri Mar 9 18:21:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabiano Rosas X-Patchwork-Id: 10271615 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 4419B603B5 for ; Fri, 9 Mar 2018 18:26:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3938729E97 for ; Fri, 9 Mar 2018 18:26:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D5C929EB4; Fri, 9 Mar 2018 18:26:37 +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 BD7B329E97 for ; Fri, 9 Mar 2018 18:26:36 +0000 (UTC) Received: from localhost ([::1]:47262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMix-0000jZ-PH for patchwork-qemu-devel@patchwork.kernel.org; Fri, 09 Mar 2018 13:26:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMfJ-0005ZV-GM for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euMfF-0001le-Eu for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:49 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35224) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1euMfF-0001l8-7C for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:45 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w29IKq23145734 for ; Fri, 9 Mar 2018 13:22:44 -0500 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gkyfd02dy-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 09 Mar 2018 13:22:43 -0500 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Mar 2018 13:22:42 -0500 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 9 Mar 2018 13:22:41 -0500 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w29IMe0149938568; Fri, 9 Mar 2018 18:22:40 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 02E7CAC040; Fri, 9 Mar 2018 13:23:55 -0500 (EST) Received: from farosas.localdomain.com (unknown [9.85.169.23]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id DB6ABAC03A; Fri, 9 Mar 2018 13:23:53 -0500 (EST) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Fri, 9 Mar 2018 15:21:59 -0300 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180309182202.31206-1-farosas@linux.vnet.ibm.com> References: <20180309182202.31206-1-farosas@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18030918-0040-0000-0000-000004051358 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008642; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01000629; UDB=6.00508989; IPR=6.00779959; MB=3.00019943; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-09 18:22:42 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030918-0041-0000-0000-000008061A9A Message-Id: <20180309182202.31206-4-farosas@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-09_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803090223 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 3/5] block/throttle: Remove protocol-related fields 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: kwolf@redhat.com, qemu-block@nongnu.org, mreitz@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 throttle driver is not a protocol so it should implement bdrv_open instead of bdrv_file_open and not provide a protocol_name. Attempts to invoke this driver using protocol syntax (i.e. throttle:) will now fail gracefully: $ qemu-img info throttle:foo qemu-img: Could not open 'throttle:foo': Unknown protocol 'throttle' Signed-off-by: Fabiano Rosas Reviewed-by: Max Reitz --- block/throttle.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/throttle.c b/block/throttle.c index 5f4d43d0fc..95ed06acd8 100644 --- a/block/throttle.c +++ b/block/throttle.c @@ -215,10 +215,9 @@ static void coroutine_fn throttle_co_drain_end(BlockDriverState *bs) static BlockDriver bdrv_throttle = { .format_name = "throttle", - .protocol_name = "throttle", .instance_size = sizeof(ThrottleGroupMember), - .bdrv_file_open = throttle_open, + .bdrv_open = throttle_open, .bdrv_close = throttle_close, .bdrv_co_flush = throttle_co_flush,