]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: command: add support to enable/disable hotplug on pci-root controller
authorAni Sinha <ani@anisinha.ca>
Fri, 1 Oct 2021 09:29:47 +0000 (14:59 +0530)
committerLaine Stump <laine@redhat.com>
Fri, 1 Oct 2021 18:42:18 +0000 (14:42 -0400)
commit133d7983d6c37248e01d075f84410bb8b9487f5d
treed6c150b68eaf97a00891814d8f45d2eb7f59eadc
parent8eadf82fb59604a97c1473ddd1e41860dcde0410
qemu: command: add support to enable/disable hotplug on pci-root controller

This change adds qemu backend command line support for enabling or disabling
hotplug on the pci-root controller using the 'target' sub-element of the
pci-root controller as shown below:

<controller type='pci' model='pci-root'>
  <target hotplug='off'/>
</controller>

'<target hotplug='off/on'/>' is only valid for pc (i440fx-based x86)
machinetypes and turns on the following command line option that is passed
to qemu for x86 guests:

-global PIIX4_PM.acpi-root-pci-hotplug=<off/on>

Before introduction of this attribute, hotplug was always enabled for
pci-root of an i440fx-based machinetype, and since its introduction
the default setting has always been "on" for those machinetypes.

This change also adds the required qemuxml2argv unit tests in order to test
correct qemu arguments. Unit tests have also been added to test qemu capability
validation checks.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.args [new file with mode: 0644]
tests/qemuxml2argvdata/pc-i440fx-acpi-root-hotplug-disable.err [new file with mode: 0644]
tests/qemuxml2argvtest.c