Skip to content

Commit 5228fae

Browse files
authored
kvm: pre-add 32 PCI controller for hot-plug issue on ARM64 (#5193)
On newer libvirt/qemu it seems PCI hot-plugging could be an issue as seen in: https://www.suse.com/support/kb/doc/?id=000019383 https://bugs.launchpad.net/nova/+bug/1836065 This was found to be true on ARM64/aarch64 platform (tested on RaspberryPi4). As per the default machine doc, it advises to pre-allocate PCI controllers on the machine and pcie-to-pci-bridge based controller for legacy PCI models: https://libvirt.org/pci-hotplug.html#x86_64-q35 This patch introduces the concept as a workaround until a proper fix is done (ideally in the upstream libvirt/qemu projects). Until then client code can add 32 PCI controllers and a pcie-to-pci-bridge controller for aarch64 platforms. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent e0141ab commit 5228fae

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,15 @@ public String toString() {
530530
devicesBuilder.append(dev.toString());
531531
}
532532
}
533+
534+
if (_emulator != null && _emulator.endsWith("aarch64")) {
535+
devicesBuilder.append("<controller type='pci' model='pcie-root'/>\n");
536+
for (int i = 0; i < 32; i++) {
537+
devicesBuilder.append("<controller type='pci' model='pcie-root-port'/>\n");
538+
}
539+
devicesBuilder.append("<controller type='pci' model='pcie-to-pci-bridge'/>\n");
540+
}
541+
533542
devicesBuilder.append("</devices>\n");
534543
return devicesBuilder.toString();
535544
}

0 commit comments

Comments
 (0)