Revision 4cff0a59 hw/acpi_piix4.c

b/hw/acpi_piix4.c
585 585
    PIIX4_DPRINTF("pciej write %x <== %d\n", addr, val);
586 586
}
587 587

  
588
static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev, int state);
588
static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,
589
                                PCIHotplugState state);
589 590

  
590 591
static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s)
591 592
{
......
615 616
    s->pci0_status.down |= (1 << slot);
616 617
}
617 618

  
618
static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev, int state)
619
static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,
620
				PCIHotplugState state)
619 621
{
620 622
    int slot = PCI_SLOT(dev->devfn);
621 623
    PIIX4PMState *s = DO_UPCAST(PIIX4PMState, dev,
622 624
                                DO_UPCAST(PCIDevice, qdev, qdev));
623 625

  
624
    if (!dev->qdev.hotplugged)
626
    /* Don't send event when device is enabled during qemu machine creation:
627
     * it is present on boot, no hotplug event is necessary. We do send an
628
     * event when the device is disabled later. */
629
    if (state == PCI_COLDPLUG_ENABLED) {
625 630
        return 0;
631
    }
626 632

  
627 633
    s->pci0_status.up = 0;
628 634
    s->pci0_status.down = 0;
629
    if (state) {
635
    if (state == PCI_HOTPLUG_ENABLED) {
630 636
        enable_device(s, slot);
631 637
    } else {
632 638
        disable_device(s, slot);

Also available in: Unified diff