From nobody Mon Feb 9 03:48:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1655209815; cv=none; d=zohomail.com; s=zohoarc; b=c/HWcbmIpzLpbGNKUq2H1SFImlSCDi1bgcetuCbE8kSPREHuVlo59Cqx/r/0XgZo/AjODMgX8RrsQyDyKtQOJPw5NXIUgzdYwTqA1GZMDTKl04mDpNVOiGM6turGvuayuNzBMpUxu4kg7M7c+nFe5jwfz3KFf6CHwyu6hc8Ve0g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655209815; 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=Y7SbtI+KOdhUyXPlF06GwiiQ347PA+DRoHS7kH2Ql4A=; b=hSllhoUDli0dFYzw2Fp712P/j66pZgg9SsoSOpoKJfPZLrEG3LFXlogvgBwh+ajeu6KMrnA3ZwhklXdVSPZlI2Xhv5eG2wg1P5Oy7WqLuiRL4x8Wli7RzMhaNryZaNLAT+aQM/4aw46y5nUNP7ofgVxdXL5sy9S0dKF07HdC+1k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1655209815385202.01993526960916; Tue, 14 Jun 2022 05:30:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-175-ZNW87wZ5NjCVoChYWuX1Ig-1; Tue, 14 Jun 2022 08:29:06 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 552A029DD98F; Tue, 14 Jun 2022 12:28:59 +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 3AF72404E4C2; Tue, 14 Jun 2022 12:28:59 +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 DC551194707B; Tue, 14 Jun 2022 12:28:58 +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 DBD1A1947070 for ; Tue, 14 Jun 2022 12:28:57 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B710FC23DBF; Tue, 14 Jun 2022 12:28:57 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id F298FC28118 for ; Tue, 14 Jun 2022 12:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655209814; 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=Y7SbtI+KOdhUyXPlF06GwiiQ347PA+DRoHS7kH2Ql4A=; b=UK3DfgZ80f3+NrU2VLwLLHarm5TNbQMaXcuKp/ZX2gHu5/AEvMRsIuU9XXBWbSXlb3644h qMbhMpeQSiJ+4u1A4ZJ+leReGMjRv7AmaRG4rjQ1IIKhuMo4qUkqvOsz7+AfXCSOzgOU0i QCclUq9UYf65LusMv0NZ2gpiIRuR470= X-MC-Unique: ZNW87wZ5NjCVoChYWuX1Ig-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/4] virDomainDiskDefValidateStartupPolicy: Validate disk type better Date: Tue, 14 Jun 2022 14:28:51 +0200 Message-Id: <8ee0f0fc1f21ed36073bba0ccc1f48fdec26da45.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.84 on 10.11.54.2 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: 1655209816521100001 Content-Type: text/plain; charset="utf-8" Our startup policy checkers work only for local paths, so disk sources such as NVMe, or vhost-user can't be used with startup policy. Unfortunately the validation did not catch these cases. Fix it. Signed-off-by: Peter Krempa --- src/conf/domain_validate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 70e9167eac..9c55d05cac 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -638,7 +638,10 @@ virDomainDiskDefValidateStartupPolicy(const virDomainD= iskDef *disk) if (disk->startupPolicy =3D=3D VIR_DOMAIN_STARTUP_POLICY_DEFAULT) return 0; - if (disk->src->type =3D=3D VIR_STORAGE_TYPE_NETWORK) { + /* We want to allow any startup policy for un-translated _TYPE_VOLUME = disks. + * virStorageSourceGetActualType returns _TYPE_VOLUME in such case */ + if (virStorageSourceGetActualType(disk->src) !=3D VIR_STORAGE_TYPE_VOL= UME && + !virStorageSourceIsLocalStorage(disk->src)) { virReportError(VIR_ERR_XML_ERROR, _("disk startupPolicy '%s' is not allowed for disk = of '%s' type"), virDomainStartupPolicyTypeToString(disk->startupPol= icy), --=20 2.36.1