From nobody Sun Dec 29 19:15:19 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1719037204; cv=none; d=zohomail.com; s=zohoarc; b=AokkNEst5cnar38ustx3x+OMu0Ob4cJsTvnDvNWi2GU4PsVXR9rxJqxskge5i+I9555sL6lQaXSC5qccwPtRtR1JFW4Zn73s81P4l7V/HAEx6xKwGOUs14az7k3E87O1wHQnRDbgzRGlGrpA/DY0Tz6WNHX29gNsEhlxbBvi9t4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719037204; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=yrycet3jL1WSrURyl4kYUHh4gIffr2JcIs+cSDvgvbc=; b=ZbxMDibhTkJmqQ64Ntsx5vdvAU6s+fFRMJdGZWWYcINlu6DSKm1aEID1aULhbIcdTJQ7gYf+HfBZHh4HPQMvDxzHTF//DoMEv7aakWUfvUhXS9GA83M6jiqG7WgZDnxQ25e8XUuoeeRY8UPJNTztZFl+NB/ANrzjtUoyi29t3BY= 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+importer2=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 1719037204452813.9881716330536; Fri, 21 Jun 2024 23:20:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKu3d-0000Zz-IX; Sat, 22 Jun 2024 02:17:07 -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 1sKu3O-0000Sj-O0 for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:50 -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 1sKu3N-0006Uf-Cr for qemu-devel@nongnu.org; Sat, 22 Jun 2024 02:16:50 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-18-BUyPwInlNt2yhZJF7BGTvg-1; Sat, 22 Jun 2024 02:16:44 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a6fe871a5aeso8412266b.2 for ; Fri, 21 Jun 2024 23:16:44 -0700 (PDT) Received: from avogadro.local ([151.62.196.71]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf560ad2sm158996266b.173.2024.06.21.23.16.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 23:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719037008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yrycet3jL1WSrURyl4kYUHh4gIffr2JcIs+cSDvgvbc=; b=I5HbbvpvLtpX52JYXAen92RQhZk0Nb15mL96GpdPzfDIMSRSqX9ihFtUTfHaLSlvUWU91P iv1RaMOsZe/VEu90p6ETPNYREHMY1EUVExhqMkM5+9DtObZW1g0hZwDsMFs4VGHLwLyg4G dCEGsMFbmI/uCX70E8SfxEJhbCeHZhk= X-MC-Unique: BUyPwInlNt2yhZJF7BGTvg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719037002; x=1719641802; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yrycet3jL1WSrURyl4kYUHh4gIffr2JcIs+cSDvgvbc=; b=Hc/Cm/TM94l6EfFp9MYhUxpPHxLDLZWOuVk7xKKNpJuycY38krI/B9tgVDddWrSftm FXRhQh6qBOyargP9KsHLIXIKmpaCRjMUK+j5rerqyFI0iN09dgIzNwkjDNNdfxyHqD5x qYaJZaY3zLg2nEa2ScRoAqPQV8knMQCray3NaqiUGiJIe8vfoIAXW7AbCvnkAPf5kMIS dGVdIqYn+vYiMXhEg8KcOs27tjFYz5rmubVgcumIpsS4apb97XnrvVciMrcr0Wnoc0PA KZPHlmer1nTq3k0c+sJ1x8+SYMOladxBHfipm2Uf1K9XoNdl0w0OhBssG3L6Ejf+qksy owJA== X-Gm-Message-State: AOJu0YwM9lWa/NwGURFGyRoNl0vlbxeRBQ2sffW5PlZTp4smtQG1DBUQ hdXAyC+oQ/k4jsC2qSPF9J/JMxGGJ57Q1nx6gvlPn16ctP9+lu2kytsKZxIE36WfWhlE/iuDg/T d/q0/phgBCoLRnWsxYUo5kkEPE8sKayaGbAb+A/YbBYm8cjj15CAD7VnGEMdDpGB+Pf65GhKXgB 3MqmeoUOeCivKqiVdJ2XmkluD7V4gyDl6/ZHNN X-Received: by 2002:a17:906:bf45:b0:a6f:5db5:71a0 with SMTP id a640c23a62f3a-a6fab602c9emr712358666b.14.1719037002612; Fri, 21 Jun 2024 23:16:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG02UMRoMIQfh+0IUhhOOuBtKoryQodMVv5YNLt8O0yU4nfSjN1jAB9D9ZlT/3pTSXFC04Rag== X-Received: by 2002:a17:906:bf45:b0:a6f:5db5:71a0 with SMTP id a640c23a62f3a-a6fab602c9emr712357866b.14.1719037002238; Fri, 21 Jun 2024 23:16:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 18/23] block: make assertion more generic Date: Sat, 22 Jun 2024 08:15:52 +0200 Message-ID: <20240622061558.530543-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622061558.530543-1-pbonzini@redhat.com> References: <20240622061558.530543-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+importer2=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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1719037206516100005 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 --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index 468cf5e67d7..69a2905178a 100644 --- a/block.c +++ b/block.c @@ -1655,8 +1655,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.45.2