5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-10 01:18:01 +03:00

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 <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2015-03-17 09:47:10 +01:00 committed by Dietmar Maurer
parent c0e303885a
commit fc79e81353

View File

@ -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;