qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] pci: deassert intx when pci device unrealize
@ 2017-04-25  2:29 Herongguang (Stephen)
  2017-04-25  5:09 ` Marcel Apfelbaum
  0 siblings, 1 reply; 2+ messages in thread
From: Herongguang (Stephen) @ 2017-04-25  2:29 UTC (permalink / raw)
  To: Michael S. Tsirkin, marcel, qemu-devel
  Cc: qemu-stable, 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 <herongguang.he@huawei.com>
---
  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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] pci: deassert intx when pci device unrealize
  2017-04-25  2:29 [Qemu-devel] [PATCH] pci: deassert intx when pci device unrealize Herongguang (Stephen)
@ 2017-04-25  5:09 ` Marcel Apfelbaum
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Apfelbaum @ 2017-04-25  5:09 UTC (permalink / raw)
  To: Herongguang (Stephen), Michael S. Tsirkin, qemu-devel
  Cc: qemu-stable, wangxinxin.wang@huawei.com >> wangxin (U)

On 04/25/2017 05:29 AM, Herongguang (Stephen) wrote:
> 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>
> ---
>  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



Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-25  5:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25  2:29 [Qemu-devel] [PATCH] pci: deassert intx when pci device unrealize Herongguang (Stephen)
2017-04-25  5:09 ` Marcel Apfelbaum

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).