提交 9baffe90 编写于 作者: J Jonathon Jongsma 提交者: Erik Skultety

nodedev: make iommuGroup optional for mdevs

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: NJonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 ea332004
......@@ -390,8 +390,9 @@
<dt><code>iommuGroup</code></dt>
<dd>
This element supports a single attribute <code>number</code>
which holds the IOMMU group number the mediated device belongs
to.
which holds the IOMMU group number to which the mediated device
belongs. This is a read-only field that is reported by the
device driver.
</dd>
</dl>
</dd>
......
......@@ -629,11 +629,13 @@
<data type='string'/>
</attribute>
</element>
<element name='iommuGroup'>
<attribute name='number'>
<ref name='unsignedInt'/>
</attribute>
</element>
<optional>
<element name='iommuGroup'>
<attribute name='number'>
<ref name='unsignedInt'/>
</attribute>
</element>
</optional>
</define>
<define name='capccwdev'>
......
......@@ -1775,13 +1775,15 @@ virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt,
goto out;
}
if (virNodeDevCapsDefParseULong("number(./iommuGroup[1]/@number)", ctxt,
&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 value 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;
}
ret = 0;
out:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册