[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 12/13] pci: move unregister from PCIDevice to PC
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH 12/13] pci: move unregister from PCIDevice to PCIDeviceInfo |
Date: |
Wed, 23 Sep 2009 18:58:45 +0300 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
On Tue, Sep 22, 2009 at 11:29:26AM +0200, Gerd Hoffmann wrote:
> diff --git a/hw/pci.c b/hw/pci.c
> index a6cd630..3221a6c 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -26,6 +26,7 @@
> #include "monitor.h"
> #include "net.h"
> #include "sysemu.h"
> +#include "msix.h"
>
> //#define DEBUG_PCI
> #ifdef DEBUG_PCI
> @@ -402,13 +403,15 @@ static void pci_unregister_io_regions(PCIDevice
> *pci_dev)
> static int pci_unregister_device(DeviceState *dev)
> {
> PCIDevice *pci_dev = DO_UPCAST(PCIDevice, qdev, dev);
> + PCIDeviceInfo *info = DO_UPCAST(PCIDeviceInfo, qdev, dev->info);
> int ret = 0;
>
> - if (pci_dev->unregister)
> - ret = pci_dev->unregister(pci_dev);
> + if (info->exit)
> + ret = info->exit(pci_dev);
> if (ret)
> return ret;
>
> + msix_uninit(pci_dev);
> pci_unregister_io_regions(pci_dev);
>
> qemu_free_irqs(pci_dev->irq);
Since devices call msix_add, I think it is cleaner to have them
uninit it as well in their exit routines.
--
MST
- Re: [Qemu-devel] [PATCH 07/13] piix_pci: kill PIIX3IrqState, (continued)
- [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Gerd Hoffmann, 2009/09/22
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Markus Armbruster, 2009/09/24
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Gerd Hoffmann, 2009/09/25
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Markus Armbruster, 2009/09/25
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Gerd Hoffmann, 2009/09/25
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Artyom Tarasenko, 2009/09/25
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Markus Armbruster, 2009/09/25
[Qemu-devel] [PATCH 12/13] pci: move unregister from PCIDevice to PCIDeviceInfo, Gerd Hoffmann, 2009/09/22
- Re: [Qemu-devel] [PATCH 12/13] pci: move unregister from PCIDevice to PCIDeviceInfo,
Michael S. Tsirkin <=
[Qemu-devel] [PATCH 09/13] Add exit callback to DeviceInfo., Gerd Hoffmann, 2009/09/22
[Qemu-devel] [PATCH 13/13] usb: hook unplug into qdev, cleanups + fixes., Gerd Hoffmann, 2009/09/22
[Qemu-devel] [PATCH 06/13] convert pci bridge to qdev, Gerd Hoffmann, 2009/09/22