void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,

                               DeviceState *dev, Error **errp)

{

    PCIDevice *pdev = PCI_DEVICE(dev);

    int slot = PCI_SLOT(pdev->devfn);

    int bsel = acpi_pcihp_get_bsel(pdev->bus);

    if (bsel < 0) {

        error_setg(errp, "Unsupported bus. Bus doesn't have property '"

                   ACPI_PCIHP_PROP_BSEL "' set");

        return;

    }



    /* Don't send event when device is enabled during qemu machine creation:

     * it is present on boot, no hotplug event is necessary. We do send an

     * event when the device is disabled later. */

    if (!dev->hotplugged) {

        return;

    }



    s->acpi_pcihp_pci_status[bsel].up |= (1U << slot);

    acpi_send_event(DEVICE(hotplug_dev), ACPI_PCI_HOTPLUG_STATUS);

}

void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,

                               DeviceState *dev, Error **errp)

{

    PCIDevice *pdev = PCI_DEVICE(dev);

    int slot = PCI_SLOT(pdev->devfn);

    int bsel = acpi_pcihp_get_bsel(pdev->bus);

    if (bsel < 0) {

        error_setg(errp, "Unsupported bus. Bus doesn't have property '"

                   ACPI_PCIHP_PROP_BSEL "' set");

        return;

    }



    





    if (!dev->hotplugged) {

        return;

    }



    s->acpi_pcihp_pci_status[bsel].up |= (1U << slot);

    acpi_send_event(DEVICE(hotplug_dev), ACPI_PCI_HOTPLUG_STATUS);

}

void FUNC_0(HotplugHandler *VAR_0, AcpiPciHpState *VAR_1,

                               DeviceState *VAR_2, Error **VAR_3)

{

    PCIDevice *pdev = PCI_DEVICE(VAR_2);

    int VAR_4 = PCI_SLOT(pdev->devfn);

    int VAR_5 = acpi_pcihp_get_bsel(pdev->bus);

    if (VAR_5 < 0) {

        error_setg(VAR_3, "Unsupported bus. Bus doesn't have property '"

                   ACPI_PCIHP_PROP_BSEL "' set");

        return;

    }



    





    if (!VAR_2->hotplugged) {

        return;

    }



    VAR_1->acpi_pcihp_pci_status[VAR_5].up |= (1U << VAR_4);

    acpi_send_event(DEVICE(VAR_0), ACPI_PCI_HOTPLUG_STATUS);

}

void FUNC_0(HotplugHandler *VAR_0, AcpiPciHpState *VAR_1,
DeviceState *VAR_2, Error **VAR_3)
{ PCIDevice *pdev = PCI_DEVICE(VAR_2); int VAR_4 = PCI_SLOT(pdev->devfn); int VAR_5 = acpi_pcihp_get_bsel(pdev->bus); if (VAR_5 < 0) { error_setg(VAR_3, "Unsupported bus. Bus doesn't have property '"
ACPI_PCIHP_PROP_BSEL "' set"); return; } if (!VAR_2->hotplugged) { return; } VAR_1->acpi_pcihp_pci_status[VAR_5].up |= (1U << VAR_4); acpi_send_event(DEVICE(VAR_0), ACPI_PCI_HOTPLUG_STATUS); }