From nobody Sat Feb 7 18:46:27 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=1607466092; cv=none; d=zohomail.com; s=zohoarc; b=UnZtH8RChsJA3iSvLy0eq+dCS8vnpWSfZElHgwBe1CfvzO/zFbwwHQcisp0369NbrtsCB7isvPiZeIFQfmrcUkDcjpbO0VSZthx/JI0PIEpTbUxoUWwzdUTDYrOWyBM4kl24ZiT6Hx75t/t9wZSwc85zS5damSrouWb9aCK/goI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607466092; 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=R+sFuW4vRgHxAzI3jLpsgNzMamngqlf74RN5MtajteY=; b=Ik0yz7G5BN6VYclpr2vlWWNRWAafFr3XWdvnrcuGWJTVECTvR3ZF3OKiPfqtHdDAiwzwQAfGDIx2tQoRqqN8sEjD3jZ49Pifaxh709Gu9exmbakmJgrppIiJmiGe7U3nh3U3LtorWsvPNQTy0md8Q1U7t34+LM7yOOPRJ6gYN8A= 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 1607466092684986.4597619294474; Tue, 8 Dec 2020 14:21:32 -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-382-Um4BB8pBPWinu5uwBqZnoQ-1; Tue, 08 Dec 2020 17:21:29 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2C0AE803627; Tue, 8 Dec 2020 22:21:24 +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 0AD0C13470; Tue, 8 Dec 2020 22:21:24 +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 C757C50034; Tue, 8 Dec 2020 22:21:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B8MLK1g017499 for ; Tue, 8 Dec 2020 17:21:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id AD7F8A9FB9; Tue, 8 Dec 2020 22:21:20 +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 A8147A9FBD for ; Tue, 8 Dec 2020 22:21:20 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (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 94A52800969 for ; Tue, 8 Dec 2020 22:21:20 +0000 (UTC) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-24KmHZCdN3i7ND-EWJSBpA-1; Tue, 08 Dec 2020 17:21:16 -0500 Received: by mail-qk1-f178.google.com with SMTP id b144so174594qkc.13; Tue, 08 Dec 2020 14:21:16 -0800 (PST) Received: from rekt.redhat.com ([2804:431:c7c7:c1a:69c1:2b22:e880:fc49]) by smtp.gmail.com with ESMTPSA id c14sm75057qtg.85.2020.12.08.14.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 14:21:15 -0800 (PST) X-MC-Unique: Um4BB8pBPWinu5uwBqZnoQ-1 X-MC-Unique: 24KmHZCdN3i7ND-EWJSBpA-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=R+sFuW4vRgHxAzI3jLpsgNzMamngqlf74RN5MtajteY=; b=DM5oFxSXUuE4BeF78mV9gmLYyrZTToYpkwt9k/OirzcwpRcOazlQ7cciucK8PX6TsU r/GrPf4WXoRCJ+rIxb0+e/lSHBkDUESbF+QMrZu0JX3lm2T6R01/oFkgBGylFJ6iOtE0 bMhfp0ZnhcAG3Kx0+hKdpcdTGeYs5OmiaN+CFvhugnwpGMtoCzCyCjN4qaTKjWyHYT/J lz4hxlpy6r64gEH9SOLNEgZXBRW8GSJ1gERe93LNGbWuU1jnvnacuUMHXFMqEMY6r0jo tRTRwVysjSCYu8XrTM6x9AMEosXEe4GPf+nOOofgICJeSWZLk0cdWT24BHUim70BbMVE gN5w== X-Gm-Message-State: AOAM533iQQ7USSR5h9+7MWR5iOOJ7PdbC8B9mYtwwVYOOzHdr9Ig2ggI KqPooL7/GRzmREpHm/eDvW8FObRjnVo= X-Google-Smtp-Source: ABdhPJwdb6RWjgam7VQNHKVeikBANeXAK3n4Vq4kN6CuR34Dtgf2kAfOX69P2ikTJGZcevf4XIOm+g== X-Received: by 2002:a05:620a:1265:: with SMTP id b5mr33362264qkl.27.1607466075838; Tue, 08 Dec 2020 14:21:15 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 13/14] domain_conf: move pci-root/pcie-root address check to domain_validate.c Date: Tue, 8 Dec 2020 19:20:29 -0300 Message-Id: <20201208222030.1302229-14-danielhb413@gmail.com> In-Reply-To: <20201208222030.1302229-1-danielhb413@gmail.com> References: <20201208222030.1302229-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.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Michal Privoznik , 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.11 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" Reviewed-by: Michal Privoznik Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 6 ------ src/conf/domain_validate.c | 10 ++++++++++ tests/qemuxml2argvdata/pci-root-address.err | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7adf2700ae..7a7c9ec85c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10820,12 +10820,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")); - return NULL; - } if ((rc =3D virParseScaledValue("./pcihole64", NULL, ctxt, &bytes, 1024, 1024ULL * ULONG_MAX, false)) < 0) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index f47e80ca38..35deb9f017 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -525,6 +525,16 @@ virDomainControllerDefValidate(const virDomainControll= erDef *controller) if (controller->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI) { const virDomainPCIControllerOpts *opts =3D &controller->opts.pciop= ts; =20 + if (controller->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT = || + controller->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT= ) { + if (controller->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 (controller->idx > 255) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("PCI controller index %d too high, maximum is= 255"), 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