From nobody Mon Feb 9 17:24:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1598975801; cv=none; d=zohomail.com; s=zohoarc; b=XrE5A5Foz0dugIJF5dTi+ljwJnmikPlKzVBQcTngbJ4FJ0kllF2Ul4BqoMp4vnctAhdk8DJRPsqvWl5LGCGwaBhiV68yGHU8cn4hI36P6Zl5wUgB9TYf71NRdzVVmN5Nj46ViCbTKGY3go9HRlE/apAevkSySY/829+vjBz9NAQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598975801; 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=qHLEjMtBt7F7cNQsVcsHosnooGWLOpmL44yUhTZ+o2c=; b=lq8RqAs7CLyT2fYiFnjaZA4bKm24yEgaSg4QHY7wKpYUl8+NJZ2Hgt7jKfVIwU+RjHciuzi5njCz6HPhekvtl/ZCeuIhmc98zg9N48sc4vYQYBZAnwGAO6m68vXcpCnLGqzP0wBWdU/gh6LseFmZcqnXKdaSKEksQkQ0O8Inm5w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598975801829508.3621600812296; Tue, 1 Sep 2020 08:56:41 -0700 (PDT) Received: from localhost ([::1]:35838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD7oc-0006KN-F3 for importer@patchew.org; Tue, 01 Sep 2020 11:03:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD7Nm-0000hP-5C for qemu-devel@nongnu.org; Tue, 01 Sep 2020 10:35:34 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:43494 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kD7Nh-0007HV-1R for qemu-devel@nongnu.org; Tue, 01 Sep 2020 10:35:33 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-541-SD89FdEhOR6txIy6iGdT1A-1; Tue, 01 Sep 2020 10:35:25 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A0E0F802B4B; Tue, 1 Sep 2020 14:35:24 +0000 (UTC) Received: from localhost (ovpn-113-83.ams2.redhat.com [10.36.113.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 46EE87DA24; Tue, 1 Sep 2020 14:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598970927; 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=qHLEjMtBt7F7cNQsVcsHosnooGWLOpmL44yUhTZ+o2c=; b=cw7/VxJpcQC7Vc6i4d5SMQz4x4vILSl+PyM10TfvNW4iti2vT1y1HnA+bMNSdLTnPsJB7w tir4Lhn6d3xeV010NCyrETQnLxz7AxVAqNWyzTjvgHIkriFCVnAJdoMF/WQUYuKzAYfypd hSg1uTLBwMipGGN2mTCSJkhwamnrpCU= X-MC-Unique: SD89FdEhOR6txIy6iGdT1A-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PATCH v8 25/43] blockdev: Use CAF in external_snapshot_prepare() Date: Tue, 1 Sep 2020 16:34:06 +0200 Message-Id: <20200901143424.884735-26-mreitz@redhat.com> In-Reply-To: <20200901143424.884735-1-mreitz@redhat.com> References: <20200901143424.884735-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mreitz@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com 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=207.211.31.120; envelope-from=mreitz@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/01 00:57:59 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H2=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Andrey Shinkevich , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This allows us to differentiate between filters and nodes with COW backing files: Filters cannot be used as overlays at all (for this function). Signed-off-by: Max Reitz Reviewed-by: Andrey Shinkevich Reviewed-by: Kevin Wolf --- blockdev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 862aa1b9aa..57ee41b73e 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1562,7 +1562,12 @@ static void external_snapshot_prepare(BlkActionState= *common, goto out; } =20 - if (state->new_bs->backing !=3D NULL) { + if (state->new_bs->drv->is_filter) { + error_setg(errp, "Filters cannot be used as overlays"); + goto out; + } + + if (bdrv_cow_child(state->new_bs)) { error_setg(errp, "The overlay already has a backing image"); goto out; } --=20 2.26.2