From nobody Fri May 3 14:26:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685620399; cv=none; d=zohomail.com; s=zohoarc; b=ZWXqNS+FREusLVgCdHqfS9xX51Cv7inhSjiAxVrJjm4tceLKXhdyHNCoi3HVSA1cW7E4zltOHXCeezmQTMPz4sMeNze78LWtvyS15TsBPzD/KPCoc/NydOGcY4/JvPSwfHH74MqfOR0Q1EklJTvBBmS+1cSI57VJ9r472Y12ze4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685620399; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5gDo6gRhnvor6PQVhdFMG1bnfIKAfrOm4x58U0jQHcE=; b=l74NnHA0XyOs2fFoW3LcXF+MFkttEpSEWRyrj2RLtevL+OZuYxzWHYNI5QxCk9CmpIDY4lYiAP24Po9LEpANMuUwX53UXQP3pE4sUJZxBnnMBERwPOBRVsVUxibGNbmR8K2aqLaE7z2WES/ykVEEAeDjjVVwU0yzeVRqZpbPjI0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685620399405236.73089745028187; Thu, 1 Jun 2023 04:53:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4gqK-0008Sq-Rq; Thu, 01 Jun 2023 07:51:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4gqJ-0008GY-8q for qemu-devel@nongnu.org; Thu, 01 Jun 2023 07:51:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4gqH-0000Gt-SS for qemu-devel@nongnu.org; Thu, 01 Jun 2023 07:51:46 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-468-dHGZ1vY-MXSjK5Bbh64f6w-1; Thu, 01 Jun 2023 07:51:44 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-94a356c74e0so50873566b.2 for ; Thu, 01 Jun 2023 04:51:43 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id c19-20020a170906341300b00965f98eefc1sm10466643ejb.116.2023.06.01.04.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 04:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685620305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5gDo6gRhnvor6PQVhdFMG1bnfIKAfrOm4x58U0jQHcE=; b=Nv3myeRCDUjA3wYchbE3j3VNfnXZuEBbAwBXSpIUwq2orJr5/loMNaEsE2zATo0mRu2uoT fPh3Oa856JH90OiY2XbzUOTzPhP5tOnxhDr00AManIEmNBt4JIjAkC2Gf6XaDMky72EudA AIv3/SkOPXs06yUvaVXxEvhJpNxLXoY= X-MC-Unique: dHGZ1vY-MXSjK5Bbh64f6w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685620302; x=1688212302; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5gDo6gRhnvor6PQVhdFMG1bnfIKAfrOm4x58U0jQHcE=; b=HnIzso2LgWLHoCBav5tfqhpaJy4K7Ux3o2oRdEsCxLU7JdTsAn/Uryd6gPxCkVOxZQ ez2JdL4FWLsAv8r/KZw/CTr5gCYFGUrzL+534es/NYSC23MC3esyiAbQyo/lQFPNMkES 2QWzOuRDO6rBI7YTvsO3BSNJhPwKE8Qi7c1a0kc4BpKiRWJ6LbhcGY84PdnZzdErBdhT XVAAHnR6QJnrIXBSCh9CnNvO4h34mnPwwTrQ+bNiGetHD+xzEqtq5JTtfonXBC9p9rtt RL+VJrFFhltrajH7ahBUC7TJPKXPx8DqBenUiTbBCTKdduFUw9oOu7a13R6qOAUbrG4c QFNQ== X-Gm-Message-State: AC+VfDw//lpxiLbReQAjSm3s4PTV6xXh3n0fb8bFixCEaF4KoIDYjSDe YzCVIZ+69Q0JiCM50eOL2ZiHTgH5EIsYAJxOiGRCIyq4ZFhrjjL7EQvQCugkpc5+nR+iwfh+dmr cbxGhsMi8y1Zgr2F6P1fMaZEy+F4HoyXwoUfawmbA4rYDxrB0ZqJukaCU9fMa70+xOLb4yYN0q8 U= X-Received: by 2002:a17:907:d0c:b0:96a:9c44:86d9 with SMTP id gn12-20020a1709070d0c00b0096a9c4486d9mr8781030ejc.12.1685620302521; Thu, 01 Jun 2023 04:51:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60C75LqAkDl27yGKwB67uYdzdkUlhpUoRMZIKrN9sisGO1Z929QAeqAgYp7LQPMStLMa3xQw== X-Received: by 2002:a17:907:d0c:b0:96a:9c44:86d9 with SMTP id gn12-20020a1709070d0c00b0096a9c4486d9mr8781015ejc.12.1685620302306; Thu, 01 Jun 2023 04:51:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org Subject: [PATCH v2 1/3] block: make assertion more generic Date: Thu, 1 Jun 2023 13:51:37 +0200 Message-Id: <20230601115139.196369-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230601115139.196369-1-pbonzini@redhat.com> References: <20230601115139.196369-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.166, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685620400699100005 Content-Type: text/plain; charset="utf-8" .bdrv_needs_filename is only set for drivers that also set bdrv_file_open, i.e. protocol drivers. So we can make the assertion always, it will always pass for those drivers that use bdrv_open. Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index dae629075c2c..a1452e747b62 100644 --- a/block.c +++ b/block.c @@ -1627,8 +1627,8 @@ bdrv_open_driver(BlockDriverState *bs, BlockDriver *d= rv, const char *node_name, bs->drv =3D drv; bs->opaque =3D g_malloc0(drv->instance_size); =20 + assert(!drv->bdrv_needs_filename || bs->filename[0]); if (drv->bdrv_file_open) { - assert(!drv->bdrv_needs_filename || bs->filename[0]); ret =3D drv->bdrv_file_open(bs, options, open_flags, &local_err); } else if (drv->bdrv_open) { ret =3D drv->bdrv_open(bs, options, open_flags, &local_err); --=20 2.40.1 From nobody Fri May 3 14:26:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685620395047589.1884823957978; Thu, 1 Jun 2023 04:53:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4gqV-0000m8-PR; Thu, 01 Jun 2023 07:51:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4gqS-0000jN-8P for qemu-devel@nongnu.org; Thu, 01 Jun 2023 07:51:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4gqQ-0000KN-FO for qemu-devel@nongnu.org; Thu, 01 Jun 2023 07:51:55 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-159-qVoCfgtUPji0155Mk3Nygw-1; Thu, 01 Jun 2023 07:51:45 -0400 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-96fa4c724fdso251622866b.0 for ; Thu, 01 Jun 2023 04:51:45 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id s15-20020a170906960f00b00966069b78absm10390641ejx.192.2023.06.01.04.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 04:51:43 -0700 (PDT) X-MC-Unique: qVoCfgtUPji0155Mk3Nygw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685620304; x=1688212304; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=td+aVHnUrsWpkhBWzhnvbYh0/myIf5m6/5vEaonDHfM=; b=AwqiYSO/csHpkxPiOMxVyHhSS/F4a+TqXCecidV8iag9k1/77gsCojxNFkRB/8G9U9 XhglrpiI4iTwVECbB4hUFIdZtaPNW4Gx/6pi6VAnq7lP8naS0SjTZIm4Y/d1EKYeaZr5 TU/tRkcH68lXwX/tk2VhhPtTPMw4AASY/dHYmPUU1KZeEQLfvJ0ewyjtyW6nq/FHk422 J2QsfbBc5IkkCNS5AFT9y1dtbr/4/KO/Nspp3/erEGUBpueqbNYibeEXH6D/FnUOFAc1 LHWFFhX2872zfsFVnWDW1FzIAAIn5ijz1nq905bkv8UT/ov8swgg59OFM41svmuNiE5m 3f4Q== X-Gm-Message-State: AC+VfDy1HKf7E28yYb6FHu/nRpUVxftHO5Fh0bmiFYZR8cJ3x5hj97St quEpbdydb5HRRtNxRN5aiFEpC7WFWBJ1I8u+MvsrbN0p/K9bGExE/hIgM4ZEjRNqBUJkFGWF1Ox AQ+WnrQOSwdUdkDdgycq6KLw5Ed/Ob4p1wcfg8DdJjXa66mTodFdrys4Ct2m80bEUF6pawuSGVw o= X-Received: by 2002:a17:907:7f9e:b0:969:df2e:d7d1 with SMTP id qk30-20020a1709077f9e00b00969df2ed7d1mr1666433ejc.24.1685620303906; Thu, 01 Jun 2023 04:51:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7SlMLA2HpvzGikCqbqvjVSKgxa2K/sQxt0EGp5hqnV7bFj7dOJgsY29puBJA9iZlyYm0qhgQ== X-Received: by 2002:a17:907:7f9e:b0:969:df2e:d7d1 with SMTP id qk30-20020a1709077f9e00b00969df2ed7d1mr1666422ejc.24.1685620303729; Thu, 01 Jun 2023 04:51:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org Subject: [PATCH v2 2/3] block: do not check bdrv_file_open Date: Thu, 1 Jun 2023 13:51:38 +0200 Message-Id: <20230601115139.196369-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230601115139.196369-1-pbonzini@redhat.com> References: <20230601115139.196369-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1685620395341100001 Content-Type: text/plain; charset="utf-8" The set of BlockDrivers that have .bdrv_file_open coincides with those that have .protocol_name and guess what---checking drv->bdrv_file_open is done to see if the driver is a protocol. So check drv->protocol_name instead. Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake --- block.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/block.c b/block.c index a1452e747b62..40eeda213666 100644 --- a/block.c +++ b/block.c @@ -913,7 +913,6 @@ BlockDriver *bdrv_find_protocol(const char *filename, int i; =20 GLOBAL_STATE_CODE(); - /* TODO Drivers without bdrv_file_open must be specified explicitly */ =20 /* * XXX(hch): we really should not let host device detection @@ -1949,7 +1948,7 @@ static int bdrv_open_common(BlockDriverState *bs, Blo= ckBackend *file, open_flags =3D bdrv_open_flags(bs, bs->open_flags); node_name =3D qemu_opt_get(opts, "node-name"); =20 - assert(!drv->bdrv_file_open || file =3D=3D NULL); + assert(!drv->protocol_name || file =3D=3D NULL); ret =3D bdrv_open_driver(bs, drv, node_name, options, open_flags, errp= ); if (ret < 0) { goto fail_opts; @@ -2049,7 +2048,7 @@ static int bdrv_fill_options(QDict **options, const c= har *filename, } /* If the user has explicitly specified the driver, this choice sh= ould * override the BDRV_O_PROTOCOL flag */ - protocol =3D drv->bdrv_file_open; + protocol =3D drv->protocol_name; } =20 if (protocol) { @@ -4017,7 +4016,7 @@ bdrv_open_inherit(const char *filename, const char *r= eference, QDict *options, } =20 /* BDRV_O_PROTOCOL must be set iff a protocol BDS is about to be creat= ed */ - assert(!!(flags & BDRV_O_PROTOCOL) =3D=3D !!drv->bdrv_file_open); + assert(!!(flags & BDRV_O_PROTOCOL) =3D=3D !!drv->protocol_name); /* file must be NULL if a protocol BDS is about to be created * (the inverse results in an error message from bdrv_open_common()) */ assert(!(flags & BDRV_O_PROTOCOL) || !file); @@ -5816,7 +5815,7 @@ int64_t coroutine_fn bdrv_co_get_allocated_file_size(= BlockDriverState *bs) return drv->bdrv_co_get_allocated_file_size(bs); } =20 - if (drv->bdrv_file_open) { + if (drv->protocol_name) { /* * Protocol drivers default to -ENOTSUP (most of their data is * not stored in any of their children (if they even have any), @@ -7932,7 +7931,7 @@ void bdrv_refresh_filename(BlockDriverState *bs) * Both of these conditions are represented by generate_json_fil= ename. */ if (primary_child_bs->exact_filename[0] && - primary_child_bs->drv->bdrv_file_open && + primary_child_bs->drv->protocol_name && !drv->is_filter && !generate_json_filename) { strcpy(bs->exact_filename, primary_child_bs->exact_filename); --=20 2.40.1 From nobody Fri May 3 14:26:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685620507; cv=none; d=zohomail.com; s=zohoarc; b=Y3HqaBwNwZilSJGodzU10hMvnJ0vLoSWaA+RJyYQ2xxyJvj1nM/6Vw0/18Op2gUvS8dZeGGd7UHXaROBPycvtfWZew9qkD+mlzgoJ28sB2l2tT48DqPR9VemCdY9Iu53iBPHqr2fMoSmkhRojOaxVdnqBeX5pN83IRbo0xlAvvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685620507; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h0dtoDna82+jGvTTbAjDQ/EMDiDJX2YjJKQvonAYv2Q=; b=hk04e7t5GMYvlfH7aJoDnsiAWCuyBlZ1LLg888PfJ+7wNloVvA3ueKcbbHVwyNB0J1IsWd8ZsBGeazCCbl9UvK/48gP/6xWKndicGbdHx+vkzPkx3xFLhO1dGe2q8Gpe0w6JTQpdzEdKxRKgKKbIsmdKknuwtn/+3ZfgbCrfGcg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685620507094877.7554174804445; Thu, 1 Jun 2023 04:55:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4gqP-0000W8-6i; Thu, 01 Jun 2023 07:51:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4gqN-0000Ja-5t for qemu-devel@nongnu.org; Thu, 01 Jun 2023 07:51:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4gqK-0000IQ-Vt for qemu-devel@nongnu.org; Thu, 01 Jun 2023 07:51:50 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-156--HEtoTGwOoulQOBnxgXY9g-1; Thu, 01 Jun 2023 07:51:47 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-9737cde2ce8so103201666b.1 for ; Thu, 01 Jun 2023 04:51:46 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id a6-20020a1709063a4600b00973fac6065esm6372778ejf.223.2023.06.01.04.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 04:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685620308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h0dtoDna82+jGvTTbAjDQ/EMDiDJX2YjJKQvonAYv2Q=; b=X+fsBRDQ0YZJl5GTxaBm6GRBBsR4uZszBr79Vq6e4n3Y8QnhuNBuqtZVxD6iXmEpIr7OgG IfgCW6UF/I5qL/knoYSALSJs7468SM4sLJfYruMGogRDGI+P+ex18aa6pW0oEFkyGMfBoU OFgNyp+1ZflYQI5+hFuukEMhYJv28Kc= X-MC-Unique: -HEtoTGwOoulQOBnxgXY9g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685620305; x=1688212305; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h0dtoDna82+jGvTTbAjDQ/EMDiDJX2YjJKQvonAYv2Q=; b=bt52fblVOLphzrcbYRSD9FFAUAAXCiJvxdtI92+5XZOymE4ISzey91b/0Co37jiBEc 5pGqLp/LtJrgmZ1qjFxq73suspCvzTONS/a5PupBWee1O8nWxFc3LxRKzPLGnphkNEOJ mTJXXe3D9UotzwZtiO/xhCQHK1PJi9GY8JSpSUwqRbaSFae14Yx5nx7DX1ouSptnmvxT rXRCpF5c4KPQwjOr7OwWvY2+MJQHYFht/QukQQgju76k0CYC+5o8kWna1x+Fvx9j2wMb xjNQy1GWhWMCT3pywWLZpnpPVd7RQcXWR7rXEuyww1mYMKrYSeIKqS+3Um2YPv4CT9o5 jwng== X-Gm-Message-State: AC+VfDyiFK3fuD/PoXHwceusyX8Jq7Y6C3qHFeO6X6Y7P9WesARRNNn7 s/5ysBOADrKuV+E+HTX9b9rdLDgxUrCRBzVsx+d0Fj0Tbew4R9Vz9L6UFNByeszamBKGDbwnhnb nhxGL9uYVQj/L/Im81A5nvLJ3RanWcsU1Q1LKG+MfVcvjugCJn7iTe9A3FBAJBbNb4ifpqr29kU c= X-Received: by 2002:a17:907:3eaa:b0:96f:add6:c1ed with SMTP id hs42-20020a1709073eaa00b0096fadd6c1edmr1279590ejc.38.1685620305517; Thu, 01 Jun 2023 04:51:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7F8NIw6Tx6ZlWGVNjxl21AXHHWhajRIE5+KjMa2MrLMZon6RHMciY+ZTZtdXpnlIyJ9m+z4A== X-Received: by 2002:a17:907:3eaa:b0:96f:add6:c1ed with SMTP id hs42-20020a1709073eaa00b0096fadd6c1edmr1279577ejc.38.1685620305172; Thu, 01 Jun 2023 04:51:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org Subject: [PATCH v2 3/3] block: remove separate bdrv_file_open callback Date: Thu, 1 Jun 2023 13:51:39 +0200 Message-Id: <20230601115139.196369-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230601115139.196369-1-pbonzini@redhat.com> References: <20230601115139.196369-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.166, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685620509227100003 Content-Type: text/plain; charset="utf-8" bdrv_file_open and bdrv_open are completely equivalent, they are never checked except to see which one to invoke. So merge them into a single one. Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake --- block.c | 4 +--- block/blkdebug.c | 2 +- block/blkio.c | 2 +- block/blkverify.c | 2 +- block/curl.c | 8 ++++---- block/file-posix.c | 8 ++++---- block/file-win32.c | 4 ++-- block/gluster.c | 8 ++++---- block/iscsi.c | 4 ++-- block/nbd.c | 6 +++--- block/nfs.c | 2 +- block/null.c | 4 ++-- block/nvme.c | 2 +- block/rbd.c | 3 ++- block/ssh.c | 2 +- block/vvfat.c | 2 +- include/block/block_int-common.h | 3 --- 17 files changed, 31 insertions(+), 35 deletions(-) diff --git a/block.c b/block.c index 40eeda213666..113e3d90fd52 100644 --- a/block.c +++ b/block.c @@ -1627,9 +1627,7 @@ bdrv_open_driver(BlockDriverState *bs, BlockDriver *d= rv, const char *node_name, bs->opaque =3D g_malloc0(drv->instance_size); =20 assert(!drv->bdrv_needs_filename || bs->filename[0]); - if (drv->bdrv_file_open) { - ret =3D drv->bdrv_file_open(bs, options, open_flags, &local_err); - } else if (drv->bdrv_open) { + if (drv->bdrv_open) { ret =3D drv->bdrv_open(bs, options, open_flags, &local_err); } else { ret =3D 0; diff --git a/block/blkdebug.c b/block/blkdebug.c index addad914b3f7..c9ae3cb6ae3d 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -1072,7 +1072,7 @@ static BlockDriver bdrv_blkdebug =3D { .is_filter =3D true, =20 .bdrv_parse_filename =3D blkdebug_parse_filename, - .bdrv_file_open =3D blkdebug_open, + .bdrv_open =3D blkdebug_open, .bdrv_close =3D blkdebug_close, .bdrv_reopen_prepare =3D blkdebug_reopen_prepare, .bdrv_child_perm =3D blkdebug_child_perm, diff --git a/block/blkio.c b/block/blkio.c index 72117fa0059b..202cf20ca4bb 100644 --- a/block/blkio.c +++ b/block/blkio.c @@ -992,7 +992,7 @@ static void blkio_refresh_limits(BlockDriverState *bs, = Error **errp) .format_name =3D name, \ .protocol_name =3D name, \ .instance_size =3D sizeof(BDRVBlkioState), \ - .bdrv_file_open =3D blkio_file_open, \ + .bdrv_open =3D blkio_open, \ .bdrv_close =3D blkio_close, \ .bdrv_co_getlength =3D blkio_co_getlength, \ .bdrv_co_truncate =3D blkio_truncate, \ diff --git a/block/blkverify.c b/block/blkverify.c index 7326461f30e0..263166046ea6 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -313,7 +313,7 @@ static BlockDriver bdrv_blkverify =3D { .instance_size =3D sizeof(BDRVBlkverifyState), =20 .bdrv_parse_filename =3D blkverify_parse_filename, - .bdrv_file_open =3D blkverify_open, + .bdrv_open =3D blkverify_open, .bdrv_close =3D blkverify_close, .bdrv_child_perm =3D bdrv_default_perms, .bdrv_co_getlength =3D blkverify_co_getlength, diff --git a/block/curl.c b/block/curl.c index 0fc42d03d777..cd2dee3f0a8b 100644 --- a/block/curl.c +++ b/block/curl.c @@ -1032,7 +1032,7 @@ static BlockDriver bdrv_http =3D { =20 .instance_size =3D sizeof(BDRVCURLState), .bdrv_parse_filename =3D curl_parse_filename, - .bdrv_file_open =3D curl_open, + .bdrv_open =3D curl_open, .bdrv_close =3D curl_close, .bdrv_co_getlength =3D curl_co_getlength, =20 @@ -1051,7 +1051,7 @@ static BlockDriver bdrv_https =3D { =20 .instance_size =3D sizeof(BDRVCURLState), .bdrv_parse_filename =3D curl_parse_filename, - .bdrv_file_open =3D curl_open, + .bdrv_open =3D curl_open, .bdrv_close =3D curl_close, .bdrv_co_getlength =3D curl_co_getlength, =20 @@ -1070,7 +1070,7 @@ static BlockDriver bdrv_ftp =3D { =20 .instance_size =3D sizeof(BDRVCURLState), .bdrv_parse_filename =3D curl_parse_filename, - .bdrv_file_open =3D curl_open, + .bdrv_open =3D curl_open, .bdrv_close =3D curl_close, .bdrv_co_getlength =3D curl_co_getlength, =20 @@ -1089,7 +1089,7 @@ static BlockDriver bdrv_ftps =3D { =20 .instance_size =3D sizeof(BDRVCURLState), .bdrv_parse_filename =3D curl_parse_filename, - .bdrv_file_open =3D curl_open, + .bdrv_open =3D curl_open, .bdrv_close =3D curl_close, .bdrv_co_getlength =3D curl_co_getlength, =20 diff --git a/block/file-posix.c b/block/file-posix.c index 0ab158efba28..942f529f6ffc 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -3904,7 +3904,7 @@ BlockDriver bdrv_file =3D { .bdrv_needs_filename =3D true, .bdrv_probe =3D NULL, /* no probe for protocols */ .bdrv_parse_filename =3D raw_parse_filename, - .bdrv_file_open =3D raw_open, + .bdrv_open =3D raw_open, .bdrv_reopen_prepare =3D raw_reopen_prepare, .bdrv_reopen_commit =3D raw_reopen_commit, .bdrv_reopen_abort =3D raw_reopen_abort, @@ -4278,7 +4278,7 @@ static BlockDriver bdrv_host_device =3D { .bdrv_needs_filename =3D true, .bdrv_probe_device =3D hdev_probe_device, .bdrv_parse_filename =3D hdev_parse_filename, - .bdrv_file_open =3D hdev_open, + .bdrv_open =3D hdev_open, .bdrv_close =3D raw_close, .bdrv_reopen_prepare =3D raw_reopen_prepare, .bdrv_reopen_commit =3D raw_reopen_commit, @@ -4420,7 +4420,7 @@ static BlockDriver bdrv_host_cdrom =3D { .bdrv_needs_filename =3D true, .bdrv_probe_device =3D cdrom_probe_device, .bdrv_parse_filename =3D cdrom_parse_filename, - .bdrv_file_open =3D cdrom_open, + .bdrv_open =3D cdrom_open, .bdrv_close =3D raw_close, .bdrv_reopen_prepare =3D raw_reopen_prepare, .bdrv_reopen_commit =3D raw_reopen_commit, @@ -4549,7 +4549,7 @@ static BlockDriver bdrv_host_cdrom =3D { .bdrv_needs_filename =3D true, .bdrv_probe_device =3D cdrom_probe_device, .bdrv_parse_filename =3D cdrom_parse_filename, - .bdrv_file_open =3D cdrom_open, + .bdrv_open =3D cdrom_open, .bdrv_close =3D raw_close, .bdrv_reopen_prepare =3D raw_reopen_prepare, .bdrv_reopen_commit =3D raw_reopen_commit, diff --git a/block/file-win32.c b/block/file-win32.c index 48b790d91739..7e1baa1ece6a 100644 --- a/block/file-win32.c +++ b/block/file-win32.c @@ -746,7 +746,7 @@ BlockDriver bdrv_file =3D { .instance_size =3D sizeof(BDRVRawState), .bdrv_needs_filename =3D true, .bdrv_parse_filename =3D raw_parse_filename, - .bdrv_file_open =3D raw_open, + .bdrv_open =3D raw_open, .bdrv_refresh_limits =3D raw_probe_alignment, .bdrv_close =3D raw_close, .bdrv_co_create_opts =3D raw_co_create_opts, @@ -920,7 +920,7 @@ static BlockDriver bdrv_host_device =3D { .bdrv_needs_filename =3D true, .bdrv_parse_filename =3D hdev_parse_filename, .bdrv_probe_device =3D hdev_probe_device, - .bdrv_file_open =3D hdev_open, + .bdrv_open =3D hdev_open, .bdrv_close =3D raw_close, .bdrv_refresh_limits =3D hdev_refresh_limits, =20 diff --git a/block/gluster.c b/block/gluster.c index 185a83e5e533..6b25aa2516ab 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -1553,7 +1553,7 @@ static BlockDriver bdrv_gluster =3D { .format_name =3D "gluster", .protocol_name =3D "gluster", .instance_size =3D sizeof(BDRVGlusterState), - .bdrv_file_open =3D qemu_gluster_open, + .bdrv_open =3D qemu_gluster_open, .bdrv_reopen_prepare =3D qemu_gluster_reopen_prepare, .bdrv_reopen_commit =3D qemu_gluster_reopen_commit, .bdrv_reopen_abort =3D qemu_gluster_reopen_abort, @@ -1582,7 +1582,7 @@ static BlockDriver bdrv_gluster_tcp =3D { .format_name =3D "gluster", .protocol_name =3D "gluster+tcp", .instance_size =3D sizeof(BDRVGlusterState), - .bdrv_file_open =3D qemu_gluster_open, + .bdrv_open =3D qemu_gluster_open, .bdrv_reopen_prepare =3D qemu_gluster_reopen_prepare, .bdrv_reopen_commit =3D qemu_gluster_reopen_commit, .bdrv_reopen_abort =3D qemu_gluster_reopen_abort, @@ -1611,7 +1611,7 @@ static BlockDriver bdrv_gluster_unix =3D { .format_name =3D "gluster", .protocol_name =3D "gluster+unix", .instance_size =3D sizeof(BDRVGlusterState), - .bdrv_file_open =3D qemu_gluster_open, + .bdrv_open =3D qemu_gluster_open, .bdrv_reopen_prepare =3D qemu_gluster_reopen_prepare, .bdrv_reopen_commit =3D qemu_gluster_reopen_commit, .bdrv_reopen_abort =3D qemu_gluster_reopen_abort, @@ -1646,7 +1646,7 @@ static BlockDriver bdrv_gluster_rdma =3D { .format_name =3D "gluster", .protocol_name =3D "gluster+rdma", .instance_size =3D sizeof(BDRVGlusterState), - .bdrv_file_open =3D qemu_gluster_open, + .bdrv_open =3D qemu_gluster_open, .bdrv_reopen_prepare =3D qemu_gluster_reopen_prepare, .bdrv_reopen_commit =3D qemu_gluster_reopen_commit, .bdrv_reopen_abort =3D qemu_gluster_reopen_abort, diff --git a/block/iscsi.c b/block/iscsi.c index 34f97ab64605..926b19e16749 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -2426,7 +2426,7 @@ static BlockDriver bdrv_iscsi =3D { =20 .instance_size =3D sizeof(IscsiLun), .bdrv_parse_filename =3D iscsi_parse_filename, - .bdrv_file_open =3D iscsi_open, + .bdrv_open =3D iscsi_open, .bdrv_close =3D iscsi_close, .bdrv_co_create_opts =3D bdrv_co_create_opts_simple, .create_opts =3D &bdrv_create_opts_simple, @@ -2465,7 +2465,7 @@ static BlockDriver bdrv_iser =3D { =20 .instance_size =3D sizeof(IscsiLun), .bdrv_parse_filename =3D iscsi_parse_filename, - .bdrv_file_open =3D iscsi_open, + .bdrv_open =3D iscsi_open, .bdrv_close =3D iscsi_close, .bdrv_co_create_opts =3D bdrv_co_create_opts_simple, .create_opts =3D &bdrv_create_opts_simple, diff --git a/block/nbd.c b/block/nbd.c index a3f8f8a9d5ef..141a403f738c 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -2112,7 +2112,7 @@ static BlockDriver bdrv_nbd =3D { .bdrv_parse_filename =3D nbd_parse_filename, .bdrv_co_create_opts =3D bdrv_co_create_opts_simple, .create_opts =3D &bdrv_create_opts_simple, - .bdrv_file_open =3D nbd_open, + .bdrv_open =3D nbd_open, .bdrv_reopen_prepare =3D nbd_client_reopen_prepare, .bdrv_co_preadv =3D nbd_client_co_preadv, .bdrv_co_pwritev =3D nbd_client_co_pwritev, @@ -2140,7 +2140,7 @@ static BlockDriver bdrv_nbd_tcp =3D { .bdrv_parse_filename =3D nbd_parse_filename, .bdrv_co_create_opts =3D bdrv_co_create_opts_simple, .create_opts =3D &bdrv_create_opts_simple, - .bdrv_file_open =3D nbd_open, + .bdrv_open =3D nbd_open, .bdrv_reopen_prepare =3D nbd_client_reopen_prepare, .bdrv_co_preadv =3D nbd_client_co_preadv, .bdrv_co_pwritev =3D nbd_client_co_pwritev, @@ -2168,7 +2168,7 @@ static BlockDriver bdrv_nbd_unix =3D { .bdrv_parse_filename =3D nbd_parse_filename, .bdrv_co_create_opts =3D bdrv_co_create_opts_simple, .create_opts =3D &bdrv_create_opts_simple, - .bdrv_file_open =3D nbd_open, + .bdrv_open =3D nbd_open, .bdrv_reopen_prepare =3D nbd_client_reopen_prepare, .bdrv_co_preadv =3D nbd_client_co_preadv, .bdrv_co_pwritev =3D nbd_client_co_pwritev, diff --git a/block/nfs.c b/block/nfs.c index 8f89ece69fa1..d21bd93e4a40 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -890,7 +890,7 @@ static BlockDriver bdrv_nfs =3D { #endif .bdrv_co_truncate =3D nfs_file_co_truncate, =20 - .bdrv_file_open =3D nfs_file_open, + .bdrv_open =3D nfs_file_open, .bdrv_close =3D nfs_file_close, .bdrv_co_create =3D nfs_file_co_create, .bdrv_co_create_opts =3D nfs_file_co_create_opts, diff --git a/block/null.c b/block/null.c index 4808704ffd3a..6fa64d20d865 100644 --- a/block/null.c +++ b/block/null.c @@ -283,7 +283,7 @@ static BlockDriver bdrv_null_co =3D { .protocol_name =3D "null-co", .instance_size =3D sizeof(BDRVNullState), =20 - .bdrv_file_open =3D null_file_open, + .bdrv_open =3D null_file_open, .bdrv_parse_filename =3D null_co_parse_filename, .bdrv_co_getlength =3D null_co_getlength, .bdrv_co_get_allocated_file_size =3D null_co_get_allocated_file_size, @@ -304,7 +304,7 @@ static BlockDriver bdrv_null_aio =3D { .protocol_name =3D "null-aio", .instance_size =3D sizeof(BDRVNullState), =20 - .bdrv_file_open =3D null_file_open, + .bdrv_open =3D null_file_open, .bdrv_parse_filename =3D null_aio_parse_filename, .bdrv_co_getlength =3D null_co_getlength, .bdrv_co_get_allocated_file_size =3D null_co_get_allocated_file_size, diff --git a/block/nvme.c b/block/nvme.c index 17937d398db5..c6ec19484f21 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1641,7 +1641,7 @@ static BlockDriver bdrv_nvme =3D { .create_opts =3D &bdrv_create_opts_simple, =20 .bdrv_parse_filename =3D nvme_parse_filename, - .bdrv_file_open =3D nvme_file_open, + .bdrv_open =3D nvme_file_open, .bdrv_close =3D nvme_close, .bdrv_co_getlength =3D nvme_co_getlength, .bdrv_probe_blocksizes =3D nvme_probe_blocksizes, diff --git a/block/rbd.c b/block/rbd.c index 978671411ec7..9ea00d82930d 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -1811,8 +1811,9 @@ static const char *const qemu_rbd_strong_runtime_opts= [] =3D { static BlockDriver bdrv_rbd =3D { .format_name =3D "rbd", .instance_size =3D sizeof(BDRVRBDState), + .bdrv_parse_filename =3D qemu_rbd_parse_filename, - .bdrv_file_open =3D qemu_rbd_open, + .bdrv_open =3D qemu_rbd_open, .bdrv_close =3D qemu_rbd_close, .bdrv_reopen_prepare =3D qemu_rbd_reopen_prepare, .bdrv_co_create =3D qemu_rbd_co_create, diff --git a/block/ssh.c b/block/ssh.c index 2748253d4a36..3e45a98d94ec 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -1357,7 +1357,7 @@ static BlockDriver bdrv_ssh =3D { .protocol_name =3D "ssh", .instance_size =3D sizeof(BDRVSSHState), .bdrv_parse_filename =3D ssh_parse_filename, - .bdrv_file_open =3D ssh_file_open, + .bdrv_open =3D ssh_file_open, .bdrv_co_create =3D ssh_co_create, .bdrv_co_create_opts =3D ssh_co_create_opts, .bdrv_close =3D ssh_close, diff --git a/block/vvfat.c b/block/vvfat.c index 5df2d6b1c64d..2ff98af6a42c 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -3257,7 +3257,7 @@ static BlockDriver bdrv_vvfat =3D { .instance_size =3D sizeof(BDRVVVFATState), =20 .bdrv_parse_filename =3D vvfat_parse_filename, - .bdrv_file_open =3D vvfat_open, + .bdrv_open =3D vvfat_open, .bdrv_refresh_limits =3D vvfat_refresh_limits, .bdrv_close =3D vvfat_close, .bdrv_child_perm =3D vvfat_child_perm, diff --git a/include/block/block_int-common.h b/include/block/block_int-com= mon.h index b1cbc1e00cdb..371d7aaa697f 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -245,9 +245,6 @@ struct BlockDriver { int GRAPH_UNLOCKED_PTR (*bdrv_open)( BlockDriverState *bs, QDict *options, int flags, Error **errp); =20 - /* Protocol drivers should implement this instead of bdrv_open */ - int GRAPH_UNLOCKED_PTR (*bdrv_file_open)( - BlockDriverState *bs, QDict *options, int flags, Error **errp); void (*bdrv_close)(BlockDriverState *bs); =20 int coroutine_fn GRAPH_UNLOCKED_PTR (*bdrv_co_create)( --=20 2.40.1