diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-11-12 16:21:35 +0900 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-11-16 14:55:23 +0200 |
commit | e927d48722fdcba50f82d653c5a1927752483054 (patch) | |
tree | c342621b76a1c244410b83c41fff0194f0f1c094 /hw/pci.h | |
parent | 7f5feab4dda39b39dce24113313587587aa2d0ab (diff) | |
download | qemu-e927d48722fdcba50f82d653c5a1927752483054.zip qemu-e927d48722fdcba50f82d653c5a1927752483054.tar.gz qemu-e927d48722fdcba50f82d653c5a1927752483054.tar.bz2 |
pci: allow hotplug removal of cold-plugged devices
This patch fixes hot unplug of cold plugged devices
(those present at system start), which got broken by
5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 .
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Cam Macdonell <cam@cs.ualberta.ca>
Tested-by: Cam Macdonell <cam@cs.ualberta.ca>
Reported-by: Cam Macdonell <cam@cs.ualberta.ca>.
Diffstat (limited to 'hw/pci.h')
-rw-r--r-- | hw/pci.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -214,7 +214,15 @@ int pci_device_load(PCIDevice *s, QEMUFile *f); typedef void (*pci_set_irq_fn)(void *opaque, int irq_num, int level); typedef int (*pci_map_irq_fn)(PCIDevice *pci_dev, int irq_num); -typedef int (*pci_hotplug_fn)(DeviceState *qdev, PCIDevice *pci_dev, int state); + +typedef enum { + PCI_HOTPLUG_DISABLED, + PCI_HOTPLUG_ENABLED, + PCI_COLDPLUG_ENABLED, +} PCIHotplugState; + +typedef int (*pci_hotplug_fn)(DeviceState *qdev, PCIDevice *pci_dev, + PCIHotplugState state); void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent, const char *name, int devfn_min); PCIBus *pci_bus_new(DeviceState *parent, const char *name, int devfn_min); |