[pve-devel] [PATCH] add pci bridges by default for qemu > 2.3

Alexandre Derumier aderumier at odiso.com
Tue Mar 17 09:47:10 CET 2015


pci bridge are not hot-unplugglable,
which can give us live migration problem,
if we hot-unplug a device on pcibridge 1 or 2, we don't create the pci bridge on target guest

and pci bridge hotplug is not working on all os (windows for example).

So it's better to always add them at startup.

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 33bbf60..557d125 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3153,6 +3153,11 @@ sub config_to_command {
 
     if (!$q35) {
 	# add pci bridges
+        if (qemu_machine_feature_enabled ($machine_type, $kvmver, 2, 3)) {
+	   $bridges->{1} = 1;
+	   $bridges->{2} = 1;
+	}
+
 	while (my ($k, $v) = each %$bridges) {
 	    $pciaddr = print_pci_addr("pci.$k");
 	    unshift @$devices, '-device', "pci-bridge,id=pci.$k,chassis_nr=$k$pciaddr" if $k > 0;
-- 
1.7.10.4




More information about the pve-devel mailing list