From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2qFE-0005sk-3p for qemu-devel@nongnu.org; Mon, 24 Apr 2017 22:30:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2qF9-0006Se-De for qemu-devel@nongnu.org; Mon, 24 Apr 2017 22:30:24 -0400 From: "Herongguang (Stephen)" Message-ID: <58FEB4A2.8070900@huawei.com> Date: Tue, 25 Apr 2017 10:29:54 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] pci: deassert intx when pci device unrealize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , marcel@redhat.com, qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, "wangxinxin.wang@huawei.com >> wangxin (U)" 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 Signed-off-by: herongguang --- hw/pci/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 259483b..98ccc27 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); } -- 1.7.12.4