From: Herongguang (Stephen) Date: Tue, 25 Apr 2017 02:29:54 +0000 (+0800) Subject: pci: deassert intx when pci device unrealize X-Git-Tag: v2.10.0-rc0~183^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3936161f1fd72d1dfa577aaba910819c5e873260;p=thirdparty%2Fqemu.git 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 Reviewed-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 259483b1c01..98ccc275330 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -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); }