pci: deassert intx when pci device unrealize

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>
This commit is contained in:
Herongguang (Stephen) 2017-04-25 10:29:54 +08:00 committed by Michael S. Tsirkin
parent 66453cff9e
commit 3936161f1f
1 changed files with 1 additions and 0 deletions

View 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);
}