On Mon, Apr 15, 2024 at 10:53:16AM +0200, Michal Privoznik wrote:
+++ b/docs/formatdomain.rst
@@ -4153,6 +4153,12 @@ generated by libvirt. :since:`Since 1.2.19 (QEMU only)`.
``index``
pci-root controllers for pSeries guests use this attribute to record the
order they will show up in the guest. :since:`Since 3.6.0`
+``memReserve``
+ Some PCI devices have non-prefetchable memory bar larger than 2MiB. Use this
+ attribute to override value computed by firmware and thus make controller
+ reserve more memory (in KiB) so that such PCI device can be hot plugged.
+ For cold plugged PCI devices firmware recognizes this and computes correct
+ value. :since:`Since 10.3.0`
Suggestion: "For cold plugged PCI devices, the firmware will
automatically reserve the correct amount of memory."
+++ b/src/conf/domain_conf.c
@@ -8528,6 +8528,11 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt,
&def->opts.pciopts.targetIndex,
def->opts.pciopts.targetIndex) < 0)
return NULL;
+
+ if (virXMLPropULongLong(targetNodes[0], "memReserve", 0,
+ VIR_XML_PROP_NONZERO,
+ &def->opts.pciopts.memReserve) < 0)
When I saw this, I immediately thought of
https://bugzilla.redhat.com/show_bug.cgi?id=1408810
and was concerned that whatever you implemented here might rule out
potentially implementing that in the future, or having to resort to
some hacks. But since the parser will reject memReserve='0', we can
still decide to relax things in the future and permit ioReserve='0'
without creating nasty inconsistencies. Good.
Reviewed-by: Andrea Bolognani <abologna(a)redhat.com>
--
Andrea Bolognani / Red Hat / Virtualization