From nobody Mon Feb 9 12:29:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1564561965; cv=none; d=zoho.com; s=zohoarc; b=ja2M3PZK2dep/3/Ofd2UHtYkecu3u+ujH3V/Tv/DmYY2of6x06PS1/osCv++KYXX9XZTp9Aez8+gGQdPxnJ5AYB20bdO81lMYMQrcW+jsJ++IGgvHz7kAtAOnW9G8MLknqSqcs6fqTKxDdRZmrdyGlXPyfP28zts5Kl708/YojM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564561965; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=uUK+5HnJgX5AXGjsj7jJ4CADAAl/K4TuSyU/qMeInmk=; b=a9x8v3JWRt7EuOuJzjIhrGumcSJfTSy2feDVBvZFtIIFBnMQ/iiLKlbdll0DajtKJBqY9z2ZqTdBPbCPeZZCr1uoTDIhEX/SPjRwz5/G3hEtX3hm79kYtTI9CdDVeJgKsmmrIUPUF26v3q98qemY1Iog8LWB7YGn73Gt0h1fjec= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1564561965118605.2542418673454; Wed, 31 Jul 2019 01:32:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E08073084025; Wed, 31 Jul 2019 08:32:43 +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 B4E2B5D6D0; Wed, 31 Jul 2019 08:32:43 +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 3305819731; Wed, 31 Jul 2019 08:32:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6V8WXGM027400 for ; Wed, 31 Jul 2019 04:32:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id CCFFB5D6B2; Wed, 31 Jul 2019 08:32:33 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58E9B5D70D for ; Wed, 31 Jul 2019 08:32:33 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 31 Jul 2019 10:32:24 +0200 Message-Id: <5c63accbe35d7229b4f8951d16853a60f3f48f24.1564561646.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/6] virpci: Allow greater PCI domain value in virPCIDeviceAddressIsValid 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 31 Jul 2019 08:32:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" There is no restriction on maximum value of PCI domain. In fact, Linux kernel uses plain atomic inc when assigning PCI domains: drivers/pci/pci.c:static int pci_get_new_domain_nr(void) drivers/pci/pci.c-{ drivers/pci/pci.c- return atomic_inc_return(&__domain_nr); drivers/pci/pci.c-} Of course, this function is called only if kernel was compiled without PCI domain support or ACPI did not provide PCI domain. However, QEMU still has the same restriction as us: in set_pci_host_devaddr() QEMU checks if domain isn't greater than 0xffff. But one can argue that that's a QEMU limitation. We still want to be able to cope with other hypervisors that don't have this limitation (possibly). Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- docs/schemas/basictypes.rng | 2 +- src/util/virpci.c | 2 +- tests/qemuxml2argvdata/pci-domain-invalid.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng index 70d2101b78..81465273c8 100644 --- a/docs/schemas/basictypes.rng +++ b/docs/schemas/basictypes.rng @@ -324,7 +324,7 @@ =20 - + diff --git a/src/util/virpci.c b/src/util/virpci.c index 36b7f8b424..bc7ff46194 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -1668,7 +1668,7 @@ bool virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr, bool report) { - if (addr->domain > 0xFFFF) { + if (addr->domain > 0xFFFFFFFF) { if (report) virReportError(VIR_ERR_XML_ERROR, _("Invalid PCI address domain=3D'0x%x', " diff --git a/tests/qemuxml2argvdata/pci-domain-invalid.xml b/tests/qemuxml2= argvdata/pci-domain-invalid.xml index 1ac56fc703..21f1dc98af 100644 --- a/tests/qemuxml2argvdata/pci-domain-invalid.xml +++ b/tests/qemuxml2argvdata/pci-domain-invalid.xml @@ -26,7 +26,7 @@ -
+
--=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list