From fc79e813536966e9a08ed8daf64a680d1d670936 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Tue, 17 Mar 2015 09:47:10 +0100 Subject: [PATCH] add pci bridges by default for qemu > 2.3 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 --- PVE/QemuServer.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 33bbf600..557d1250 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;