From nobody Mon Feb 9 16:01:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1592514386; cv=none; d=zohomail.com; s=zohoarc; b=D9+SSyKwuklcguRMEP7HOpjipeTAOnkvMwqMfTcRSMiJt9C8aaPXZjNeHtmxLEI4RTCE1QmGkwR2owxGEFFy7ck9tVBu5BBwu7Unegf59+Rt0B5bf5tIShUkRKTZHNbvY+ZuU4bdTpGE3dwRwcDBi7P52mXRXrKTHdcuK6tgN7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592514386; 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=1qDLr37I6OEgzcGdqWEnxSJFN+bm0BRKGGlBGUhFrH8=; b=Ypbat2Enscm1hj4GSqieXpb6sWVOMhdqxexqFxHYfjs1ALnr36hZXLFNqHSUOlIDNZ22x292TWXTtpIJyC2LfjtDyFyU+Cyl9oMcFNKKUITnpfGl5xlYm3DAskB6Ecshw1Z3WMNMw/kv5MLiopNInoV1SSGlDBaH1FFIRkVr3U8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1592514386026709.4450549960669; Thu, 18 Jun 2020 14:06:26 -0700 (PDT) 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-390-YL-_QUF-OmGcO_ZOCBAHcw-1; Thu, 18 Jun 2020 17:06:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4A317107ACCA; Thu, 18 Jun 2020 21:06:15 +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 C576F60E1C; Thu, 18 Jun 2020 21:06:14 +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 F0D3D833C1; Thu, 18 Jun 2020 21:06:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05IL6AB3002510 for ; Thu, 18 Jun 2020 17:06:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E16360CD3; Thu, 18 Jun 2020 21:06:10 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-114-51.phx2.redhat.com [10.3.114.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D494E60E3E; Thu, 18 Jun 2020 21:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592514384; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1qDLr37I6OEgzcGdqWEnxSJFN+bm0BRKGGlBGUhFrH8=; b=BJQ0pqTweqBa7GjQk+5LE0ObX+WvalbrUvytreKRa8HY+UgCh/Ep2iXj5UmYUvUn4FELTo 9w4s7O6UhuhvNhF6cWbz76ujfR3MWPcxjphCL+ypvpkRjW+nuJMVFEofCRZtBDyLmb26+I jShs4q7CX+fi6kTlBIGES59xn0saByE= X-MC-Unique: YL-_QUF-OmGcO_ZOCBAHcw-1 From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v4 01/12] nodedev: make iommuGroup optional for mdevs Date: Thu, 18 Jun 2020 16:05:54 -0500 Message-Id: <20200618210605.12308-2-jjongsma@redhat.com> In-Reply-To: <20200618210605.12308-1-jjongsma@redhat.com> References: <20200618210605.12308-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, eskultet@redhat.com 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.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When parsing a nodedev xml file, the iommuGroup element should be optional. This element should be read-only and is determined by the device driver. While this is a change to existing behavior, it doesn't break backwards-compatibility because it makes the parser less strict. Signed-off-by: Jonathon Jongsma --- docs/formatnode.html.in | 5 +++-- docs/schemas/nodedev.rng | 12 +++++++----- src/conf/node_device_conf.c | 14 ++++++++------ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/formatnode.html.in b/docs/formatnode.html.in index 76eae928de..4ed43ec0cb 100644 --- a/docs/formatnode.html.in +++ b/docs/formatnode.html.in @@ -390,8 +390,9 @@
iommuGroup
This element supports a single attribute number - which holds the IOMMU group number the mediated device bel= ongs - to. + which holds the IOMMU group number to which the mediated d= evice + belongs. This is a read-only field that is reported by the + device driver.
diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng index fe6ffa0b53..ca3a79db87 100644 --- a/docs/schemas/nodedev.rng +++ b/docs/schemas/nodedev.rng @@ -629,11 +629,13 @@ - - - - - + + + + + + + =20 diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index bccdbd0af8..2ef4514f05 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -1775,13 +1775,15 @@ virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt, goto out; } =20 - if (virNodeDevCapsDefParseULong("number(./iommuGroup[1]/@number)", ctx= t, - &mdev->iommuGroupNumber, def, - _("missing iommuGroup number attribute= for " - "'%s'"), - _("invalid iommuGroup number attribute= for " - "'%s'")) < 0) + /* 'iommuGroup' is optional, only report an error if the supplied valu= e is + * invalid (-2), not if it's missing (-1) */ + if (virXPathUInt("number(./iommuGroup[1]/@number)", + ctxt, &mdev->iommuGroupNumber) < -1) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid iommuGroup number attribute for '%s'"), + def->name); goto out; + } =20 ret =3D 0; out: --=20 2.21.3