qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Herongguang (Stephen)" <herongguang.he@huawei.com>
To: mst@redhat.com, marcel@redhat.com,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "wangxinxin.wang@huawei.com >> wangxin (U)" <wangxinxin.wang@huawei.com>
Subject: [Qemu-devel] [RFC PATCH] pci: deassert intx when pci device unrealize
Date: Mon, 24 Apr 2017 21:12:29 +0800	[thread overview]
Message-ID: <58FDF9BD.2030100@huawei.com> (raw)

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 <herongguang.he@huawei.com>
---

Is there need to call pci_do_device_reset()?

---
  hw/pci/pci.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 259483b..afe6397 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1078,6 +1078,7 @@ static void pci_qdev_unrealize(DeviceState *dev, Error **errp)

      pci_unregister_io_regions(pci_dev);
      pci_del_option_rom(pci_dev);
+    pci_device_deassert_intx(pci_dev);

      if (pc->exit) {
          pc->exit(pci_dev);
--
1.7.12.4

             reply	other threads:[~2017-04-24 13:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24 13:12 Herongguang (Stephen) [this message]
2017-04-24 23:45 ` [Qemu-devel] [RFC PATCH] pci: deassert intx when pci device unrealize Michael S. Tsirkin
2017-04-25  2:16   ` Herongguang (Stephen)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58FDF9BD.2030100@huawei.com \
    --to=herongguang.he@huawei.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wangxinxin.wang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).