From nobody Mon Feb 9 00:02:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1655209748; cv=none; d=zohomail.com; s=zohoarc; b=O9ZD8WeiTDl2z2jmvAfhOtorzUIe1Sl0YopnbfUcsGO/Bc1mFw5MmTHNc/KgqK9x6V5NV96uWWDmLJ+QlwtM7nRotSoFgH0tivVO67luLQS/DKcdrMHbMj4CvAMQBhx951pxUNsX4fSaydqAfdTy266hbqLOVzPocQAXlI41afU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655209748; h=Content-Type:Content-Transfer-Encoding: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=BNS2hReQhWXqqJgWmJX3go5A8KulIqt1q6nwOqOBjAw=; b=CqLlIg8uOdsAlE2GKtjK+BtiiMm1mW507HlOAGZvwrP+cReXEKAIFMaqz5+q4yPGZLw6JHgfi9YexCAfNekAr5bhmGnh/cp6yQN99QMdHgTxq0eTRe0KxpHhBVdlXzzpdymDabuvXCgmSbN2p7XPa4h7xsOoycthgaMCQBF2jRk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1655209748435778.3624474694483; Tue, 14 Jun 2022 05:29:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-325-kC1AeNGcMOewxva6oeerSA-1; Tue, 14 Jun 2022 08:29:06 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B04C4181E07F; Tue, 14 Jun 2022 12:29:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 96CE4475006; Tue, 14 Jun 2022 12:29:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4C1451947070; Tue, 14 Jun 2022 12:29:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CB791194706D for ; Tue, 14 Jun 2022 12:28:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AFC29C28125; Tue, 14 Jun 2022 12:28:58 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21B88C28118 for ; Tue, 14 Jun 2022 12:28:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655209747; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=BNS2hReQhWXqqJgWmJX3go5A8KulIqt1q6nwOqOBjAw=; b=P1yW1lBT3XIgXUVU+HMA3FDZa5vErS0KP3j24E7IMepGCu/AOczYERs4tCzKDYL75SwIyu i0+R/AYeko+rmg4LJ9jeUa5Nw7lkuKFUeRFiAcTp2/cxdKvlDYI/MzzfV+YwnU5adIxI2/ XRBVuv7DGl4y/SZNFSTzKukJAzmVWSQ= X-MC-Unique: kC1AeNGcMOewxva6oeerSA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/4] virDomainDiskTranslateSourcePool: Fix check of 'startupPolicy' definition Date: Tue, 14 Jun 2022 14:28:52 +0200 Message-Id: <660ef370ebd4fe5d6aca2f55535d47702bd0efd4.1655209670.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1655209749958100005 Content-Type: text/plain; charset="utf-8" The check was historically done only for _TYPE_VOLUME disks, but refactors to allow _TYPE_VOLUME disks in the backing chain caused a regression where we'd reject startupPolicy also for _TYPE_BLOCK disks which historically worked well. Fix it by using the 'virDomainDiskDefValidateStartupPolicy' helper and use it only when the top level image is a _TYPE_VOLUME as in other cases it was already validated. This also allows _TYPE_BLOCK volumes to use startup policy. Fixes: 37f01262eed9f37dd5eb7de8b83edd2fea741054 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2095758 Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 761c3f4d87..d5c5a10a8c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -31433,13 +31433,13 @@ virDomainDiskTranslateSourcePool(virDomainDiskDef= *def) if (virDomainStorageSourceTranslateSourcePool(n, conn) < 0) return -1; - } - if (def->startupPolicy !=3D 0 && - virStorageSourceGetActualType(def->src) !=3D VIR_STORAGE_TYPE_FILE= ) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("'startupPolicy' is only valid for 'file' type vo= lume")); - return -1; + /* The validity of 'startupPolicy' setting is checked only for the= top + * level image. For any other subsequent images we honour it only = if + * possible */ + if (n =3D=3D def->src && + virDomainDiskDefValidateStartupPolicy(def) < 0) + return -1; } return 0; --=20 2.36.1