From nobody Sun May 5 19:57:41 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 1520892619561703.7592591136288; Mon, 12 Mar 2018 15:10:19 -0700 (PDT) Received: from localhost ([::1]:35841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVdx-0007NP-L8 for importer@patchew.org; Mon, 12 Mar 2018 18:10:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVc9-00069V-2J for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evVc4-00010k-1V for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:17 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53170 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 1evVc3-00010J-Sx for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:11 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2CM589U109463 for ; Mon, 12 Mar 2018 18:08:11 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gp1c1hbnx-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 12 Mar 2018 18:08:10 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Mar 2018 18:08:10 -0400 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; Mon, 12 Mar 2018 18:08:06 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2CM85UH40370268; Mon, 12 Mar 2018 22:08:05 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 38376112051; Mon, 12 Mar 2018 18:06:40 -0400 (EDT) Received: from farosas.localdomain.com (unknown [9.85.163.92]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id 6F7D3112034; Mon, 12 Mar 2018 18:06:38 -0400 (EDT) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Mon, 12 Mar 2018 19:07:49 -0300 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180312220753.20096-1-farosas@linux.vnet.ibm.com> References: <20180312220753.20096-1-farosas@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18031222-0024-0000-0000-0000033555B7 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008662; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01002144; UDB=6.00509896; IPR=6.00781474; MB=3.00019996; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-12 22:08:08 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031222-0025-0000-0000-0000474DFE31 Message-Id: <20180312220753.20096-2-farosas@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-12_13:, , 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-1803120240 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 v2 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 protocol_name field is used when selecting a driver via protocol syntax (i.e. :). Drivers that are only selected explicitly (e.g. driver=3Dreplication,mode=3Dprimary,...) should not have a protocol_name. This patch removes the protocol_name field from the brdv_replication structure so that attempts to invoke this driver using protocol syntax 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 19:57:41 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 1520892611169944.3979775399284; Mon, 12 Mar 2018 15:10:11 -0700 (PDT) Received: from localhost ([::1]:35842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVdy-0007Nx-Cu for importer@patchew.org; Mon, 12 Mar 2018 18:10:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVc9-00069c-5V for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evVc4-000115-CR for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:17 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53184 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 1evVc4-00010Y-8E for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:12 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2CM57Pq109425 for ; Mon, 12 Mar 2018 18:08:11 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gp1c1hbp6-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 12 Mar 2018 18:08:11 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Mar 2018 18:08:10 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 12 Mar 2018 18:08:09 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2CM886u39911516; Mon, 12 Mar 2018 22:08:08 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4C65E112057; Mon, 12 Mar 2018 18:06:43 -0400 (EDT) Received: from farosas.localdomain.com (unknown [9.85.163.92]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id B1EF0112054; Mon, 12 Mar 2018 18:06:41 -0400 (EDT) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Mon, 12 Mar 2018 19:07:50 -0300 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180312220753.20096-1-farosas@linux.vnet.ibm.com> References: <20180312220753.20096-1-farosas@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18031222-0040-0000-0000-000004063711 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008662; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01002144; UDB=6.00509896; IPR=6.00781474; MB=3.00019996; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-12 22:08:10 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031222-0041-0000-0000-0000080740B4 Message-Id: <20180312220753.20096-3-farosas@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-12_13:, , 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-1803120240 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 v2 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 Reviewed-by: Alberto Garcia --- 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 19:57:41 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 152089273919437.65379544360269; Mon, 12 Mar 2018 15:12:19 -0700 (PDT) Received: from localhost ([::1]:35859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVfy-0000cG-7M for importer@patchew.org; Mon, 12 Mar 2018 18:12:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVcB-0006BJ-1e for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evVc9-00013X-Ny for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:19 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57088) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1evVc9-00012s-FS for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:17 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2CM4k2C117932 for ; Mon, 12 Mar 2018 18:08:16 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gnxck082h-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 12 Mar 2018 18:08:16 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Mar 2018 18:08:15 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 12 Mar 2018 18:08:12 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2CM8BwK50462934; Mon, 12 Mar 2018 22:08:11 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 42502112034; Mon, 12 Mar 2018 18:06:46 -0400 (EDT) Received: from farosas.localdomain.com (unknown [9.85.163.92]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id DAC2E112040; Mon, 12 Mar 2018 18:06:44 -0400 (EDT) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Mon, 12 Mar 2018 19:07:51 -0300 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180312220753.20096-1-farosas@linux.vnet.ibm.com> References: <20180312220753.20096-1-farosas@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18031222-0052-0000-0000-000002C790A2 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008662; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01002144; UDB=6.00509896; IPR=6.00781474; MB=3.00019996; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-12 22:08:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031222-0053-0000-0000-00005BF980FF Message-Id: <20180312220753.20096-4-farosas@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-12_13:, , 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-1803120240 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 v2 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 Reviewed-by: Alberto Garcia --- 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 19:57:41 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 1520892872395373.37598407232235; Mon, 12 Mar 2018 15:14:32 -0700 (PDT) Received: from localhost ([::1]:35872 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVi6-0002at-Ic for importer@patchew.org; Mon, 12 Mar 2018 18:14:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVcF-0006FM-1P for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evVcA-000142-RG for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:23 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:39200 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 1evVcA-00013q-M2 for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:18 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2CM4lEN059777 for ; Mon, 12 Mar 2018 18:08:18 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gp003mgmx-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 12 Mar 2018 18:08:17 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Mar 2018 18:08:17 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 12 Mar 2018 18:08:15 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2CM8Fvi48627758; Mon, 12 Mar 2018 22:08:15 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9EF7D112051; Mon, 12 Mar 2018 18:06:49 -0400 (EDT) Received: from farosas.localdomain.com (unknown [9.85.163.92]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id BB0C5112057; Mon, 12 Mar 2018 18:06:47 -0400 (EDT) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Mon, 12 Mar 2018 19:07:52 -0300 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180312220753.20096-1-farosas@linux.vnet.ibm.com> References: <20180312220753.20096-1-farosas@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18031222-0048-0000-0000-00000248C135 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008662; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01002144; UDB=6.00509896; IPR=6.00781474; MB=3.00019995; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-12 22:08:17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031222-0049-0000-0000-0000446A9851 Message-Id: <20180312220753.20096-5-farosas@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-12_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=29 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-1803120240 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 v2 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: Pavel Dovgalyuk 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 19:57:41 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 1520892741430908.6348870304303; Mon, 12 Mar 2018 15:12:21 -0700 (PDT) Received: from localhost ([::1]:35861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVg4-0000kL-LV for importer@patchew.org; Mon, 12 Mar 2018 18:12:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVcI-0006J3-Rp for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evVcE-00015m-9t for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:26 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60584 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 1evVcE-00015c-4S for qemu-devel@nongnu.org; Mon, 12 Mar 2018 18:08:22 -0400 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 w2CM4lJw004023 for ; Mon, 12 Mar 2018 18:08:21 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gnx6y0npw-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 12 Mar 2018 18:08:21 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Mar 2018 18:08:20 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 12 Mar 2018 18:08:18 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2CM8H8t51183824; Mon, 12 Mar 2018 22:08:17 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 63FD3112040; Mon, 12 Mar 2018 18:06:52 -0400 (EDT) Received: from farosas.localdomain.com (unknown [9.85.163.92]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id 21C28112047; Mon, 12 Mar 2018 18:06:50 -0400 (EDT) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Mon, 12 Mar 2018 19:07:53 -0300 X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180312220753.20096-1-farosas@linux.vnet.ibm.com> References: <20180312220753.20096-1-farosas@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18031222-0052-0000-0000-000002C790A6 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008662; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01002144; UDB=6.00509896; IPR=6.00781474; MB=3.00019996; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-12 22:08:19 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031222-0053-0000-0000-00005BF98110 Message-Id: <20180312220753.20096-6-farosas@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-12_13:, , 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-1803120240 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 v2 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; - when protocol_name is set, a driver should expect to be given only a filename and no other options. Signed-off-by: Fabiano Rosas --- include/block/block_int.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/block/block_int.h b/include/block/block_int.h index 27e17addba..c4dd1d4bb8 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); @@ -251,6 +253,12 @@ struct BlockDriver { */ int coroutine_fn (*bdrv_co_flush_to_os)(BlockDriverState *bs); =20 + /* + * Drivers setting this field must be able to work with just a plain + * filename with ':' as a prefix, and no other options. + * Options may be extracted from the filename by implementing + * bdrv_parse_filename. + */ const char *protocol_name; int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset, PreallocMode prealloc, Error **errp); --=20 2.13.6