From nobody Mon Sep 8 17:08:16 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=1755621833; cv=none; d=zohomail.com; s=zohoarc; b=YM/xl69vrMj5CNx9XLCgPZAToT1n2dk17m6CzflY46t8jHVCTKjW4ZgTj3lgkyCj7MLVZNL0W6iKTZFKdhodLAyQP20NTPIpUbkJeiKQe/JsVqR1uf3UFaQ8Lfs4wTncHpFBZD80uXoLaetC2KrhRO6tBfQNGuQ/eiW0j3D47oE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1755621833; 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:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=HQNlYYwrIU/qqbovNLKcdq41I/vcaO618dyap56s0Xg=; b=eIgGTTA2lnNxoNbnCZA8gHrDvqRl5ohNrKiiQU2lmLzQTuSpof+2P99N2t1w+cfJWf/kGVF1/WhCgv3rPaG4DY5W3ZYX7wYeZZTxO+O1rsyO7GrAOan+7r7Iq0cl3FnEn+slTuAZaZ65YiDk2hPkTNoxGnhmoVBhRQz+2zcqG88= 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 1755621833509291.90740658860636; Tue, 19 Aug 2025 09:43:53 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 76F1CDCF; Tue, 19 Aug 2025 12:43:52 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 403AAE32; Tue, 19 Aug 2025 12:24:05 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A82C7D11; Tue, 19 Aug 2025 12:24:00 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7CDB1D11 for ; Tue, 19 Aug 2025 12:23:06 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-130-cIqH3ESiN-Se6CO3Vih_5Q-1; Tue, 19 Aug 2025 12:23:02 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E1FB3180044F for ; Tue, 19 Aug 2025 16:23:01 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.45.224.253]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 185A6180044F for ; Tue, 19 Aug 2025 16:23:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755620586; 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=+4WWKfL5hBn7wRB8DOhr1Ja8oegC4rdYYPDh2dE3mxA=; b=f8u67XA7Fu03WkUSKzsPbdJ8KiBZ4lHf2eOM7dRBxHqoCJc3sbsAespcFjnL7cEQ1/sZ0I jH2+lQZ6zY76tGlpa9elxX2rOUduK/jYEXlSY2up2h5wImbT3Zu+9KkSAEM1g52/CDJ1DR 1FnL03AhamvLNvyj5A72Gts5px4Y7WU= X-MC-Unique: cIqH3ESiN-Se6CO3Vih_5Q-1 X-Mimecast-MFC-AGG-ID: cIqH3ESiN-Se6CO3Vih_5Q_1755620582 To: devel@lists.libvirt.org Subject: [PATCH 16/31] qemu: Validate presence of PCI support Date: Tue, 19 Aug 2025 18:22:20 +0200 Message-ID: <20250819162235.468215-17-abologna@redhat.com> In-Reply-To: <20250819162235.468215-1-abologna@redhat.com> References: <20250819162235.468215-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Rk0jNttYXFUlt4AiXVwMC3XutPVBA1ocEjRNaPPWj28_1755620582 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: S3PPTXMMN2E42GITHG3R2BTER5DZC36D X-Message-ID-Hash: S3PPTXMMN2E42GITHG3R2BTER5DZC36D X-MailFrom: abologna@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: 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: 1755621834836116600 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 --- 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 adba3e4a89..ebcc9b8e8e 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3975,6 +3975,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.50.1