From nobody Sun Feb 8 10:48:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1607349326; cv=none; d=zohomail.com; s=zohoarc; b=cCbvmOqY38IG+rB6zgz1Qr8P3d8jGU1nY52U+iYnsCA2lSHEqJMJkoSeijdHp8T7Dpy/HTTKlR0stz/U5IQLiysEVTWUNuKHeG/qf2itMk2bgW2L0+/HYxkvqCB3qu4QB7nALDEAxymwm4xL9u5puDXjM2fGJ0lSuyydEjP/8NM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607349326; 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=acdZu16D5nehWPDC4M34CPl9kUCfYSJ8H8ihgBK1ZR8=; b=eQvLb/AAQTBeRdelqj7z4UEQKpUgTuVdiuYHNnDhTCdp0wAT0SqyySgNnzlbGjGvvezSQgI1xaKQ5AkPdFpSNnV5+7V4rS+BabIGp6YCHeRFC8WOJ8BFoZnQsIeNoNz4CnWqUpgFZ3a5QX2sCuwi1mZsxDD1AxZHMlNC94KcQ6s= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1607349326150758.7018206657984; Mon, 7 Dec 2020 05:55:26 -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-247-hywDMDyiOd6PIyVLo-cnqA-1; Mon, 07 Dec 2020 08:55:22 -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 8BB28180A094; Mon, 7 Dec 2020 13:55:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 612875D9DE; Mon, 7 Dec 2020 13:55:16 +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 E8CE11809CA6; Mon, 7 Dec 2020 13:55:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B7Dt9hl013026 for ; Mon, 7 Dec 2020 08:55:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4691B1111447; Mon, 7 Dec 2020 13:55:09 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 431F31111445 for ; Mon, 7 Dec 2020 13:55:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 F3BC185828B for ; Mon, 7 Dec 2020 13:55:06 +0000 (UTC) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-368-HT6WA10qPOWej-U9m0vmCA-1; Mon, 07 Dec 2020 08:55:04 -0500 Received: by mail-qt1-f175.google.com with SMTP id y15so1804335qtv.5 for ; Mon, 07 Dec 2020 05:55:04 -0800 (PST) Received: from rekt.redhat.com ([2804:431:c7c7:c1a:69c1:2b22:e880:fc49]) by smtp.gmail.com with ESMTPSA id n95sm12233701qte.43.2020.12.07.05.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 05:55:03 -0800 (PST) X-MC-Unique: hywDMDyiOd6PIyVLo-cnqA-1 X-MC-Unique: HT6WA10qPOWej-U9m0vmCA-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=acdZu16D5nehWPDC4M34CPl9kUCfYSJ8H8ihgBK1ZR8=; b=Ta+KNV5/26dyy3M2Iiuf3kj2oF5V0y2bfHYcnzvJMzlHo8L3HY9HydI8MZl3bPLPGw b/ahT7SHULoMRyk8ckeUz7VdM3QTUKHb2Ch+PWAf6d9a/jV39xebe4PWkvKbHkXSFPMj EiCfWiNRdaxf7IzzCKzipAWWGZpOxv3ZhZmR8wznUvce/cfbC3ocF30Koe5tnD/195YH Ct7hYT38bUNEeaZIT6GkiJWVypcniOH9zoM5mXyZI1vZJtVGv5CTJ4gtF0ptdJTl1c5f uOcZ2OBFQ7jXFd64HGtzVqI0RjSZdDSHVP5sLoXXk7TTuN/O0C/mHOej8nJcFI5ZJO++ gl+A== X-Gm-Message-State: AOAM530h5tfck6Jbl+YuFj847NZoTG9NH4hxcg+2f0hk4FHwQWSgJ9xp m51JPQLoMxN2WrAdwGk5pFZr8StlaYg= X-Google-Smtp-Source: ABdhPJy8lIEcvYXVnw9Y++/W1izT7W5QeyDIEXzgHKnIDik+VVD0VUCpnxO0+wIlkEsTPhFnbD2hKA== X-Received: by 2002:ac8:6f59:: with SMTP id n25mr11432641qtv.304.1607349303977; Mon, 07 Dec 2020 05:55:03 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 8/9] domain_conf.c: move pci-root/pcie-root address check to validateCB Date: Mon, 7 Dec 2020 10:54:34 -0300 Message-Id: <20201207135435.884594-9-danielhb413@gmail.com> In-Reply-To: <20201207135435.884594-1-danielhb413@gmail.com> References: <20201207135435.884594-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.3 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" 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 8ede532e2a..11711ba05d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6524,6 +6524,16 @@ virDomainControllerDefValidate(const virDomainContro= llerDef *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"), @@ -11392,12 +11402,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/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