From nobody Sun May 5 09:42:08 2024 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; 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 1520619985499691.6165087994489; Fri, 9 Mar 2018 10:26:25 -0800 (PST) Received: from localhost ([::1]:47259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMii-0008PK-CP for importer@patchew.org; Fri, 09 Mar 2018 13:26:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMfD-0005U1-KJ for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euMf9-0001jH-JE for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:43 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36486 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1euMf9-0001j9-E1 for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:39 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w29IKJeh061885 for ; Fri, 9 Mar 2018 13:22:39 -0500 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gkuw89awn-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 09 Mar 2018 13:22:38 -0500 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Mar 2018 13:22:38 -0500 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 9 Mar 2018 13:22:36 -0500 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w29IMZB137552346; Fri, 9 Mar 2018 18:22:35 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6758AC040; Fri, 9 Mar 2018 13:23:49 -0500 (EST) Received: from farosas.localdomain.com (unknown [9.85.169.23]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 574BDAC03A; Fri, 9 Mar 2018 13:23:48 -0500 (EST) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Fri, 9 Mar 2018 15:21:57 -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-0024-0000-0000-0000033430B1 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:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030918-0025-0000-0000-00004746670E Message-Id: <20180309182202.31206-2-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.158.5 Subject: [Qemu-devel] [PATCH 1/5] block/replication: Remove protocol_name field 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, Wen Congyang , Xie Changlong , qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The replication driver is only selected explicitly (via driver=3Dreplication,mode=3Dprimary,...) so it is not a protocol driver. This patch removes the protocol_name field from the brdv_replication structure so that attempts to invoke this driver using protocol syntax (i.e. replication:) will fail gracefully: $ qemu-img info replication:foo qemu-img: Could not open 'replication:': Unknown protocol 'replication' Buglink: https://bugs.launchpad.net/qemu/+bug/1726733 Signed-off-by: Fabiano Rosas Reviewed-by: Max Reitz --- block/replication.c | 1 - replication.h | 1 - 2 files changed, 2 deletions(-) diff --git a/block/replication.c b/block/replication.c index f98ef094b9..6c0c7186d9 100644 --- a/block/replication.c +++ b/block/replication.c @@ -703,7 +703,6 @@ static void replication_stop(ReplicationState *rs, bool= failover, Error **errp) =20 BlockDriver bdrv_replication =3D { .format_name =3D "replication", - .protocol_name =3D "replication", .instance_size =3D sizeof(BDRVReplicationState), =20 .bdrv_open =3D replication_open, diff --git a/replication.h b/replication.h index 8faefe005f..4c8354de23 100644 --- a/replication.h +++ b/replication.h @@ -67,7 +67,6 @@ typedef struct ReplicationState ReplicationState; * * BlockDriver bdrv_replication =3D { * .format_name =3D "replication", - * .protocol_name =3D "replication", * .instance_size =3D sizeof(BDRVReplicationState), * * .bdrv_open =3D replication_open, --=20 2.13.6 From nobody Sun May 5 09:42:08 2024 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; 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 1520620752250151.58223768669177; Fri, 9 Mar 2018 10:39:12 -0800 (PST) Received: from localhost ([::1]:47354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMuw-0000bx-Pm for importer@patchew.org; Fri, 09 Mar 2018 13:38:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMfH-0005Xj-HV for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euMfF-0001lK-4D for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:47 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33930) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1euMfE-0001ku-Sy for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:45 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w29IKJVZ140273 for ; Fri, 9 Mar 2018 13:22:43 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gku3aksjs-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 09 Mar 2018 13:22:43 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Mar 2018 13:22:41 -0500 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 9 Mar 2018 13:22:38 -0500 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w29IMcih58327108; Fri, 9 Mar 2018 18:22:38 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 70317AC03A; Fri, 9 Mar 2018 13:23:52 -0500 (EST) Received: from farosas.localdomain.com (unknown [9.85.169.23]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 32144AC041; Fri, 9 Mar 2018 13:23:51 -0500 (EST) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Fri, 9 Mar 2018 15:21:58 -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-0048-0000-0000-000002479DED 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:40 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030918-0049-0000-0000-00004463016B Message-Id: <20180309182202.31206-3-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=1011 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 2/5] block/quorum: 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, Alberto Garcia , qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The quorum 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. quorum:) will now fail gracefully: $ qemu-img info quorum:foo qemu-img: Could not open 'quorum:foo': Unknown protocol 'quorum' Signed-off-by: Fabiano Rosas Reviewed-by: Max Reitz --- block/quorum.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/quorum.c b/block/quorum.c index 14333c18aa..cfe484a945 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -1098,11 +1098,10 @@ static void quorum_refresh_filename(BlockDriverStat= e *bs, QDict *options) =20 static BlockDriver bdrv_quorum =3D { .format_name =3D "quorum", - .protocol_name =3D "quorum", =20 .instance_size =3D sizeof(BDRVQuorumState), =20 - .bdrv_file_open =3D quorum_open, + .bdrv_open =3D quorum_open, .bdrv_close =3D quorum_close, .bdrv_refresh_filename =3D quorum_refresh_filename, =20 --=20 2.13.6 From nobody Sun May 5 09:42:08 2024 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; 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 1520620029682964.1559985522036; Fri, 9 Mar 2018 10:27:09 -0800 (PST) Received: from localhost ([::1]:47262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMjU-0000jZ-S2 for importer@patchew.org; Fri, 09 Mar 2018 13:27:08 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(BlockDr= iverState *bs) =20 static BlockDriver bdrv_throttle =3D { .format_name =3D "throttle", - .protocol_name =3D "throttle", .instance_size =3D sizeof(ThrottleGroupMember), =20 - .bdrv_file_open =3D throttle_open, + .bdrv_open =3D throttle_open, .bdrv_close =3D throttle_close, .bdrv_co_flush =3D throttle_co_flush, =20 --=20 2.13.6 From nobody Sun May 5 09:42:08 2024 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; 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 1520620018059967.1137131850536; Fri, 9 Mar 2018 10:26:58 -0800 (PST) Received: from localhost ([::1]:47261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMjJ-0000Yz-55 for importer@patchew.org; Fri, 09 Mar 2018 13:26:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMfN-0005fE-Ll for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euMfK-0001oA-Ej for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:53 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40776 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1euMfK-0001nr-9v for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:50 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w29IKJSO069746 for ; Fri, 9 Mar 2018 13:22:49 -0500 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gkuqx9w10-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 09 Mar 2018 13:22:49 -0500 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Mar 2018 13:22:48 -0500 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 9 Mar 2018 13:22:44 -0500 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w29IMhcf43057190; Fri, 9 Mar 2018 18:22:43 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D3970AC046; Fri, 9 Mar 2018 13:23:57 -0500 (EST) Received: from farosas.localdomain.com (unknown [9.85.169.23]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 5FE38AC041; Fri, 9 Mar 2018 13:23:56 -0500 (EST) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Fri, 9 Mar 2018 15:22:00 -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-0056-0000-0000-0000042B2AF7 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:46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030918-0057-0000-0000-0000086D326A Message-Id: <20180309182202.31206-5-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.158.5 Subject: [Qemu-devel] [PATCH 4/5] block/blkreplay: 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, Paolo Bonzini , Pavel Dovgalyuk , qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The blkreplay 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. blkreplay:) will now fail gracefully: $ qemu-img info blkreplay:foo qemu-img: Could not open 'blkreplay:foo': Unknown protocol 'blkreplay' Signed-off-by: Fabiano Rosas Reviewed-by: Max Reitz --- block/blkreplay.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blkreplay.c b/block/blkreplay.c index 61e44a1949..fe5a9b4a98 100755 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -129,10 +129,9 @@ static int coroutine_fn blkreplay_co_flush(BlockDriver= State *bs) =20 static BlockDriver bdrv_blkreplay =3D { .format_name =3D "blkreplay", - .protocol_name =3D "blkreplay", .instance_size =3D 0, =20 - .bdrv_file_open =3D blkreplay_open, + .bdrv_open =3D blkreplay_open, .bdrv_close =3D blkreplay_close, .bdrv_child_perm =3D bdrv_filter_default_perms, .bdrv_getlength =3D blkreplay_getlength, --=20 2.13.6 From nobody Sun May 5 09:42:08 2024 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; 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 1520620134407842.1586551036607; Fri, 9 Mar 2018 10:28:54 -0800 (PST) Received: from localhost ([::1]:47274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMlB-0002Kh-Ij for importer@patchew.org; Fri, 09 Mar 2018 13:28:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euMfO-0005g0-AO for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euMfK-0001ny-82 for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:54 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38422 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1euMfK-0001nj-34 for qemu-devel@nongnu.org; Fri, 09 Mar 2018 13:22:50 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w29IKHMb023800 for ; Fri, 9 Mar 2018 13:22:49 -0500 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gkwwe3s3g-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 09 Mar 2018 13:22:49 -0500 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Mar 2018 13:22:48 -0500 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 9 Mar 2018 13:22:46 -0500 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w29IMk4q55509100; Fri, 9 Mar 2018 18:22:46 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E828AC040; Fri, 9 Mar 2018 13:24:00 -0500 (EST) Received: from farosas.localdomain.com (unknown [9.85.169.23]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 3C240AC03A; Fri, 9 Mar 2018 13:23:59 -0500 (EST) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Fri, 9 Mar 2018 15:22:01 -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-0036-0000-0000-000002CDDDB9 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:47 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18030918-0037-0000-0000-000043976CBD Message-Id: <20180309182202.31206-6-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.158.5 Subject: [Qemu-devel] [PATCH 5/5] include/block/block_int: Document protocol related functions 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Clarify that for protocols the brdv_file_open function is used instead of bdrv_open and that protocol_name is expected to be set. Signed-off-by: Fabiano Rosas --- include/block/block_int.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/block/block_int.h b/include/block/block_int.h index 64a5700f2b..d5e864c2dc 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -126,6 +126,8 @@ struct BlockDriver { =20 int (*bdrv_open)(BlockDriverState *bs, QDict *options, int flags, Error **errp); + + /* Protocol drivers should implement this instead of bdrv_open */ int (*bdrv_file_open)(BlockDriverState *bs, QDict *options, int flags, Error **errp); void (*bdrv_close)(BlockDriverState *bs); @@ -247,6 +249,10 @@ struct BlockDriver { */ int coroutine_fn (*bdrv_co_flush_to_os)(BlockDriverState *bs); =20 + /* + * Drivers that set this field should also provide a + * bdrv_file_open implementation + */ const char *protocol_name; int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset, PreallocMode prealloc, Error **errp); --=20 2.13.6