From: Michal Privoznik Date: Mon, 11 Sep 2023 13:59:53 +0000 (+0200) Subject: qemu_command: Generate mem-reserve for controllers X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c38720b337f74337ec94c0fe2e97a7c2c57188ae;p=libvirt.git qemu_command: Generate mem-reserve for controllers 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 Reviewed-by: Andrea Bolognani --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9d4563861f..8d4442c360 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2776,6 +2776,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; @@ -2816,6 +2817,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; @@ -2824,6 +2826,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/qemuxmlconfdata/q35-usb2.x86_64-latest.args b/tests/qemuxmlconfdata/q35-usb2.x86_64-latest.args index 717e97706e..86776e45f5 100644 --- a/tests/qemuxmlconfdata/q35-usb2.x86_64-latest.args +++ b/tests/qemuxmlconfdata/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"}' \