]> git.proxmox.com Git - qemu-server.git/commitdiff
add pci bridges by default for qemu > 2.3
authorAlexandre Derumier <aderumier@odiso.com>
Tue, 17 Mar 2015 08:47:10 +0000 (09:47 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 18 Mar 2015 05:26:55 +0000 (06:26 +0100)
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>
PVE/QemuServer.pm

index 33bbf600ec3ad493fc263c26e619a887b0f31a2d..557d125016d41fad274784294e764f18fb694193 100644 (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;