From 0bebc7624a8db4b553b893745d18b4a042dba170 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Sun, 28 Jun 2020 00:25:21 +0530 Subject: [PATCH] kvm: pre-add 32 PCI controller for hot-plug issue 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 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. Signed-off-by: Rohit Yadav (cherry picked from commit 60afad08f48f4cebf7eb7846ecf7d9eb68c0933b) Signed-off-by: Rohit Yadav --- .../java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java index 1927ddd3569..2ab97e8cf44 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java @@ -530,6 +530,11 @@ public class LibvirtVMDef { devicesBuilder.append(dev.toString()); } } + devicesBuilder.append("\n"); + for (int i = 0; i < 32; i++) { + devicesBuilder.append("\n"); + } + devicesBuilder.append("\n"); devicesBuilder.append("\n"); return devicesBuilder.toString(); }