OSDN Git Service

pci: deassert intx when pci device unrealize
authorHerongguang (Stephen) <herongguang.he@huawei.com>
Tue, 25 Apr 2017 02:29:54 +0000 (10:29 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 17 May 2017 21:35:15 +0000 (00:35 +0300)
If a pci device is not reset by VM (by writing into config space)
and unplugged by VM, after that when VM reboots, qemu may assert:
pcibus_reset: Assertion `bus->irq_count[i] == 0' failed

Cc: qemu-stable@nongnu.org
Signed-off-by: herongguang <herongguang.he@huawei.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci.c

index 259483b..98ccc27 100644 (file)
@@ -1083,6 +1083,7 @@ static void pci_qdev_unrealize(DeviceState *dev, Error **errp)
         pc->exit(pci_dev);
     }
 
+    pci_device_deassert_intx(pci_dev);
     do_pci_unregister_device(pci_dev);
 }