From nobody Sun Feb 8 15:29:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1606245700; cv=none; d=zohomail.com; s=zohoarc; b=O6eBpTVIbIedG+UEhf3l+HN0Gg3P1L+XhXqhJ3jHH772Xhp/SVHAYTvTTsE2KrtZbNkwF0GyomMzKthveR/CB6YRvT4sm2r3zOuT+9F01Xby2b8aBKVyhsM888cfGzISwH47ZUe0gzfstPEusPveKxb07m2OCrSNAgbXspfrvMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606245700; 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=dHMpqjuhvURcMWtEEuNE4M84SWaQA6106ee9Q2uaPnA=; b=dLkMI2giHL0nH3hMJDzQiki0urm6o9i6KtAqqOubK2pJY3MsPBFkiGJGX7A5eiTDu1EWaaEROekDhGBKlNXoiR8s1hwZqqRq1kJjtgfmKi4JL+4TjWpTa8ef2m9kpb9h3xyj/6OljfBgZmcXbGgK0SgT+voO60XC/kvX+Z3QI3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606245700416996.9919798021797; Tue, 24 Nov 2020 11:21:40 -0800 (PST) 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-212-hwIPsJavOvulGFzPmofoOQ-1; Tue, 24 Nov 2020 14:21:36 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9AA652FD01; Tue, 24 Nov 2020 19:21:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 48A225D9CA; Tue, 24 Nov 2020 19:21:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 11FD75003A; Tue, 24 Nov 2020 19:21:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AOJLRgs004462 for ; Tue, 24 Nov 2020 14:21:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 800D92166B2A; Tue, 24 Nov 2020 19:21:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7AAE72166B27 for ; Tue, 24 Nov 2020 19:21:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 666FD80088F for ; Tue, 24 Nov 2020 19:21:27 +0000 (UTC) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-154-O-REaioZMFuoB8bgJ-Mjkw-1; Tue, 24 Nov 2020 14:21:24 -0500 Received: by mail-qk1-f176.google.com with SMTP id i199so8676619qke.5 for ; Tue, 24 Nov 2020 11:21:24 -0800 (PST) Received: from rekt.redhat.com ([2804:431:c7c7:d88a:482:7c39:5cca:96f6]) by smtp.gmail.com with ESMTPSA id l79sm88837qke.1.2020.11.24.11.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 11:21:22 -0800 (PST) X-MC-Unique: hwIPsJavOvulGFzPmofoOQ-1 X-MC-Unique: O-REaioZMFuoB8bgJ-Mjkw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dHMpqjuhvURcMWtEEuNE4M84SWaQA6106ee9Q2uaPnA=; b=tjojj1V7KL5OTtcj2K9xgPmbDeuQLe2N0XAvbeaUJ3JywZAdxxEZk7zPDm5bkoATwX oJSbehAaDLNFsquF6DIBbLmuShe+qGru8D6osHmvqDEIEBZamO0UEfXYTCmQP/u+4mvZ qg776EyXcp2y1Z51vyYO/NreJy8Pr4Jxwf6lpFQnUaL0C5z3WO6HwT4jzKudQPGHwQe1 vNi51ul5HXXGH0sB3XoXyFfmJ91YvMtAOa5aNoW8Nn1LW+Dc+RRWwk6V3/9DS/1PMWv9 4AKBcd5+USCYdNFLwVErcOKAMouZyd3nSmaeRHOdMWEks+1dBj/IsQKS58MYY7RlVMO6 TOIg== X-Gm-Message-State: AOAM532YMYe8ik0YPDzeMKOtGeVPkAQTm40Yw8qYrtJvFjjoa7grpeDB zP3CG476pjjUcHXUbXd8dypgxNn760s= X-Google-Smtp-Source: ABdhPJyLwKCsNDFH0Oyhc/xpVNoB4mIuoPOmCTL/a2dXvx+U++rnXPs7BZWdM66Bg7AskZYVlX6J+w== X-Received: by 2002:a37:a405:: with SMTP id n5mr6538386qke.93.1606245683242; Tue, 24 Nov 2020 11:21:23 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 17/21] domain_conf.c: move pci-root/pcie-root address check to post parse Date: Tue, 24 Nov 2020 16:20:31 -0300 Message-Id: <20201124192035.2343063-18-danielhb413@gmail.com> In-Reply-To: <20201124192035.2343063-1-danielhb413@gmail.com> References: <20201124192035.2343063-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 Content-Type: text/plain; charset="utf-8" Move the check made in virDomainControllerDefParseXML() to virDomainControllerDefPostParse(). Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 16 ++++++++++------ tests/qemuxml2argvdata/pci-root-address.err | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9ca979b345..c17f5479ba 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5382,6 +5382,16 @@ virDomainControllerDefPostParse(virDomainControllerD= efPtr cdev) if (cdev->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI) { virDomainPCIControllerOpts pciOpts =3D cdev->opts.pciopts; =20 + if (cdev->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || + cdev->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) { + if (cdev->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("pci-root and pcie-root controllers " + "should not have an address")); + return -1; + } + } + if (pciOpts.chassisNr !=3D -1) { if (pciOpts.chassisNr < 1 || pciOpts.chassisNr > 255) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -11423,12 +11433,6 @@ virDomainControllerDefParseXML(virDomainXMLOptionP= tr xmlopt, case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: { unsigned long long bytes; - if (def->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("pci-root and pcie-root controllers shoul= d not " - "have an address")); - goto error; - } if ((rc =3D virParseScaledValue("./pcihole64", NULL, ctxt, &bytes, 1024, 1024ULL * ULONG_MAX, false)) < 0) diff --git a/tests/qemuxml2argvdata/pci-root-address.err b/tests/qemuxml2ar= gvdata/pci-root-address.err index 53dad81985..ffe5438224 100644 --- a/tests/qemuxml2argvdata/pci-root-address.err +++ b/tests/qemuxml2argvdata/pci-root-address.err @@ -1 +1 @@ -XML error: pci-root and pcie-root controllers should not have an address +unsupported configuration: pci-root and pcie-root controllers should not h= ave an address --=20 2.26.2