]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hw/acpi_piix4.c
Merge remote-tracking branch 'origin/master' into pci
[mirror_qemu.git] / hw / acpi_piix4.c
index 232008dd939a4542189c7a85a5a2c544a877e220..350558b8594bd46cf76037ad611f5286607594d2 100644 (file)
@@ -471,11 +471,13 @@ static void pciej_write(void *opaque, uint32_t addr, uint32_t val)
     BusState *bus = opaque;
     DeviceState *qdev, *next;
     PCIDevice *dev;
+    PCIDeviceInfo *info;
     int slot = ffs(val) - 1;
 
     QLIST_FOREACH_SAFE(qdev, &bus->children, sibling, next) {
         dev = DO_UPCAST(PCIDevice, qdev, qdev);
-        if (PCI_SLOT(dev->devfn) == slot) {
+        info = container_of(qdev->info, PCIDeviceInfo, qdev);
+        if (PCI_SLOT(dev->devfn) == slot && !info->no_hotplug) {
             qdev_free(qdev);
         }
     }