Pretty straightforward. Just put mem-reserve attribute whenever
it's set. Previous commit ensures it's set only for valid
controller models.
Resolves: https://issues.redhat.com/browse/RHEL-7461
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_command.c | 3 +++
tests/qemuxml2argvdata/q35-usb2.x86_64-latest.args | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 23909dbbab..7d611cfa87 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2679,6 +2679,7 @@ qemuBuildControllerPCIDevProps(virDomainControllerDef *def,
if (virJSONValueObjectAdd(&props,
"s:driver", modelName,
"i:chassis_nr", pciopts->chassisNr,
+ "P:mem-reserve", pciopts->memReserve * 1024,
"s:id", def->info.alias,
NULL) < 0)
return -1;
@@ -2719,6 +2720,7 @@ qemuBuildControllerPCIDevProps(virDomainControllerDef *def,
"i:chassis", pciopts->chassis,
"s:id", def->info.alias,
"T:hotplug", pciopts->hotplug,
+ "P:mem-reserve", pciopts->memReserve * 1024,
NULL) < 0)
return -1;
@@ -2727,6 +2729,7 @@ qemuBuildControllerPCIDevProps(virDomainControllerDef *def,
if (virJSONValueObjectAdd(&props,
"s:driver", modelName,
"i:index", pciopts->targetIndex,
+ "P:mem-reserve", pciopts->memReserve * 1024,
"s:id", def->info.alias,
NULL) < 0)
return -1;
diff --git a/tests/qemuxml2argvdata/q35-usb2.x86_64-latest.args b/tests/qemuxml2argvdata/q35-usb2.x86_64-latest.args
index 83eb7d7b4e..debf77b456 100644
--- a/tests/qemuxml2argvdata/q35-usb2.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/q35-usb2.x86_64-latest.args
@@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.config \
-no-shutdown \
-boot strict=on \
-device '{"driver":"i82801b11-bridge","id":"pci.1","bus":"pcie.0","addr":"0x1e"}' \
--device '{"driver":"pci-bridge","chassis_nr":56,"id":"pci.2","bus":"pci.1","addr":"0x0"}' \
+-device '{"driver":"pci-bridge","chassis_nr":56,"mem-reserve":8392704,"id":"pci.2","bus":"pci.1","addr":"0x0"}' \
-device '{"driver":"ich9-usb-ehci1","id":"usb","bus":"pcie.0","addr":"0x1d.0x7"}' \
-device '{"driver":"ich9-usb-uhci1","masterbus":"usb.0","firstport":0,"bus":"pcie.0","multifunction":true,"addr":"0x1d"}' \
-device '{"driver":"ich9-usb-uhci2","masterbus":"usb.0","firstport":2,"bus":"pcie.0","addr":"0x1d.0x1"}' \
--
2.41.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org