From nobody Sun Oct 5 01:49:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1758826327; cv=none; d=zohomail.com; s=zohoarc; b=SB5AKRWsdFTbOXQ0CtXA4JNbO6hVpWuDsWTFnBGxNKjx2abQLq4+PEIQfiMtoiP2uokulXbu+Cewc3/q5rc0UP685LOA8+u6YS6iAQFXApQS6JWdtnpJ+NbTpXXePk8Jb9rXH3uc1moUGL5wGbr2fcH6a5fD622T+gwwdQMni+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758826327; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=RnxSLmYRf67Y3hEk7rff9m60yCJJrOUw7v+NTi7xwVU=; b=kzQ48OnIaIPYoqrpI1n71x64hCBJxhCZTyx9kibk9ycmJO7oqg2YnOQ+6lwYu86O07OoHLj39D2TePjMfiHhrBbBQfC5aFRQzU8n35umMGLGHsbs9EVk51pjGq7ONEv61W99jrcgevOweByrzEGNqS/ip1RuXsMP1Es9vvGPpCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 175882632717743.44857949181903; Thu, 25 Sep 2025 11:52:07 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2F1084184D; Thu, 25 Sep 2025 14:52:05 -0400 (EDT) Received: from [172.19.199.14] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 329FB44638; Thu, 25 Sep 2025 14:18:38 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 5347D4193C; Thu, 25 Sep 2025 14:13:22 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 6764A440AA for ; Thu, 25 Sep 2025 14:07:55 -0400 (EDT) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-522-amx189FOPUeaPdoHhvXluA-1; Thu, 25 Sep 2025 14:07:52 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D5F1F1956089 for ; Thu, 25 Sep 2025 18:07:51 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.225.196]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0F39230002D1 for ; Thu, 25 Sep 2025 18:07:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758823675; 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=RnxSLmYRf67Y3hEk7rff9m60yCJJrOUw7v+NTi7xwVU=; b=WS9eKdYWcgh7EYghqPpNzYUnjwe4UgsGlINc0iSt/waXmrEomPNADW0TxzF045wko0s9rJ O1CnNECYrFdymz3044+i9J/yqWaTUY+5pKjy6PyENVd5ZDFwCyJn56PX65vmlst2Pfqam4 PO/Yhf1B7xqydmpNuimF7mTb1OESfFg= X-MC-Unique: amx189FOPUeaPdoHhvXluA-1 X-Mimecast-MFC-AGG-ID: amx189FOPUeaPdoHhvXluA_1758823671 To: devel@lists.libvirt.org Subject: [PATCH v2 17/38] qemu: Validate presence of PCI support Date: Thu, 25 Sep 2025 20:07:03 +0200 Message-ID: <20250925180724.500758-18-abologna@redhat.com> In-Reply-To: <20250925180724.500758-1-abologna@redhat.com> References: <20250925180724.500758-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: kkCpAFZEqv5Y1E9ym0PMnzQ8gCLkF6QV3FzuhwgDgqY_1758823671 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: DA4PT77FWADE3K7JJJNFWMBH5HMAHOZP X-Message-ID-Hash: DA4PT77FWADE3K7JJJNFWMBH5HMAHOZP X-MailFrom: abologna@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Andrea Bolognani via Devel Reply-To: Andrea Bolognani X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1758826328904116600 Content-Type: text/plain; charset="utf-8"; x-default="true" The qemuValidateDomainDeviceDefControllerPCI() function is called if PCI controllers are present in the domain configuration, which shouldn't happen if the machine type doesn't support PCI. If we somehow find ourselves in that scenario, reporting an error would be the right thing to do. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_validate.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index c7ecb467a3..456f9ee2f2 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3983,6 +3983,13 @@ qemuValidateDomainDeviceDefControllerPCI(const virDo= mainControllerDef *cont, return -1; } =20 + if (!qemuDomainSupportsPCI(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Machine type '%1$s' does not support PCI"), + def->os.machine); + return -1; + } + /* modelName */ switch ((virDomainControllerModelPCI) cont->model) { case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: --=20 2.51.0