* [Qemu-devel] [PATCH] qemu/pci: make pci not depend on msix
@ 2009-10-05 21:02 Michael S. Tsirkin
2009-10-05 21:21 ` [Qemu-devel] " Gerd Hoffmann
0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2009-10-05 21:02 UTC (permalink / raw)
To: qemu-devel, kraxel
Making pci device cleanup msix automatically makes pci.c depend on
msix.c, which is IMO messy. Since devices do msix_init it's easy and
natural for them to also do msix_uninit.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
hw/pci.c | 2 --
hw/virtio-pci.c | 10 +++++++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 196297a..314f826 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -26,7 +26,6 @@
#include "monitor.h"
#include "net.h"
#include "sysemu.h"
-#include "msix.h"
//#define DEBUG_PCI
#ifdef DEBUG_PCI
@@ -442,7 +441,6 @@ static int pci_unregister_device(DeviceState *dev)
if (ret)
return ret;
- msix_uninit(pci_dev);
pci_unregister_io_regions(pci_dev);
qemu_free_irqs(pci_dev->irq);
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 01782e5..e07a2a7 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -454,12 +454,17 @@ static int virtio_blk_init_pci(PCIDevice *pci_dev)
return 0;
}
+static int virtio_exit_pci(PCIDevice *pci_dev)
+{
+ return msix_uninit(pci_dev);
+}
+
static int virtio_blk_exit_pci(PCIDevice *pci_dev)
{
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
drive_uninit(proxy->dinfo);
- return 0;
+ return virtio_exit_pci(pci_dev);
}
static int virtio_console_init_pci(PCIDevice *pci_dev)
@@ -538,6 +543,7 @@ static PCIDeviceInfo virtio_info[] = {
.qdev.name = "virtio-net-pci",
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_net_init_pci,
+ .exit = virtio_exit_pci,
.qdev.props = (Property[]) {
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
NIC_NVECTORS_UNSPECIFIED),
@@ -548,6 +554,7 @@ static PCIDeviceInfo virtio_info[] = {
.qdev.name = "virtio-console-pci",
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_console_init_pci,
+ .exit = virtio_exit_pci,
.qdev.props = (Property[]) {
DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
DEFINE_PROP_END_OF_LIST(),
@@ -557,6 +564,7 @@ static PCIDeviceInfo virtio_info[] = {
.qdev.name = "virtio-balloon-pci",
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_balloon_init_pci,
+ .exit = virtio_exit_pci,
.qdev.reset = virtio_pci_reset,
},{
/* end of list */
--
1.6.5.rc2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] Re: [PATCH] qemu/pci: make pci not depend on msix
2009-10-05 21:02 [Qemu-devel] [PATCH] qemu/pci: make pci not depend on msix Michael S. Tsirkin
@ 2009-10-05 21:21 ` Gerd Hoffmann
0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2009-10-05 21:21 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: qemu-devel
On 10/05/09 23:02, Michael S. Tsirkin wrote:
> Making pci device cleanup msix automatically makes pci.c depend on
> msix.c, which is IMO messy. Since devices do msix_init it's easy and
> natural for them to also do msix_uninit.
>
> Signed-off-by: Michael S. Tsirkin<mst@redhat.com>
> Cc: Gerd Hoffmann<kraxel@redhat.com>
ACK.
Patch looks fine, and we've already agreed on doing it this way (devices
are responsible for both msix_init and msix_uninit).
I just didn't respin my patch series fast enougth ;)
cheers,
Gerd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-05 21:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-05 21:02 [Qemu-devel] [PATCH] qemu/pci: make pci not depend on msix Michael S. Tsirkin
2009-10-05 21:21 ` [Qemu-devel] " Gerd Hoffmann
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).