aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-11-12 16:21:35 +0900
committerMichael S. Tsirkin <mst@redhat.com>2010-11-16 14:55:23 +0200
commite927d48722fdcba50f82d653c5a1927752483054 (patch)
treec342621b76a1c244410b83c41fff0194f0f1c094 /hw/pci.h
parent7f5feab4dda39b39dce24113313587587aa2d0ab (diff)
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.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/pci.h b/hw/pci.h
index 7100804e7c..09b3e4c033 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -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);