コード例 #1
0
ファイル: pcie.c プロジェクト: juanquintela/qemu
void pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev,
                                     DeviceState *dev, Error **errp)
{
    Error *local_err = NULL;
    PCIDevice *pci_dev = PCI_DEVICE(dev);
    PCIBus *bus = pci_get_bus(pci_dev);

    pcie_cap_slot_plug_common(PCI_DEVICE(hotplug_dev), dev, &local_err);
    if (local_err) {
        error_propagate(errp, local_err);
        return;
    }

    /* In case user cancel the operation of multi-function hot-add,
     * remove the function that is unexposed to guest individually,
     * without interaction with guest.
     */
    if (pci_dev->devfn &&
        !bus->devices[0]) {
        pcie_unplug_device(bus, pci_dev, NULL);

        return;
    }

    pcie_cap_slot_push_attention_button(PCI_DEVICE(hotplug_dev));
}
コード例 #2
0
ファイル: pcie.c プロジェクト: THanwa/qemu
void pcie_cap_slot_hot_unplug_request_cb(HotplugHandler *hotplug_dev,
                                         DeviceState *dev, Error **errp)
{
    uint8_t *exp_cap;

    pcie_cap_slot_hotplug_common(PCI_DEVICE(hotplug_dev), dev, &exp_cap, errp);

    pcie_cap_slot_push_attention_button(PCI_DEVICE(hotplug_dev));
}