static int pci_device_hot_remove(Monitor *mon, const char *pci_addr)

{

    PCIBus *root = pci_find_primary_bus();

    PCIDevice *d;

    int bus;

    unsigned slot;

    Error *local_err = NULL;



    if (!root) {

        monitor_printf(mon, "no primary PCI bus (if there are multiple"

                       " PCI roots, you must use device_del instead)");

        return -1;

    }



    if (pci_read_devaddr(mon, pci_addr, &bus, &slot)) {

        return -1;

    }



    d = pci_find_device(root, bus, PCI_DEVFN(slot, 0));

    if (!d) {

        monitor_printf(mon, "slot %d empty\n", slot);

        return -1;

    }



    qdev_unplug(&d->qdev, &local_err);

    if (local_err) {

        monitor_printf(mon, "%s\n", error_get_pretty(local_err));

        error_free(local_err);

        return -1;

    }



    return 0;

}

static int pci_device_hot_remove(Monitor *mon, const char *pci_addr)

{

    PCIBus *root = pci_find_primary_bus();

    PCIDevice *d;

    int bus;

    unsigned slot;

    Error *local_err = NULL;



    if (!root) {

        monitor_printf(mon, "no primary PCI bus (if there are multiple"

                       " PCI roots, you must use device_del instead)");

        return -1;

    }



    if (pci_read_devaddr(mon, pci_addr, &bus, &slot)) {

        return -1;

    }



    d = pci_find_device(root, bus, PCI_DEVFN(slot, 0));

    if (!d) {

        monitor_printf(mon, "slot %d empty\n", slot);

        return -1;

    }



    qdev_unplug(&d->qdev, &local_err);

    if (local_err) {

        monitor_printf(mon, "%s\n", error_get_pretty(local_err));

        error_free(local_err);

        return -1;

    }



    return 0;

}

        return -1;         return -1;     return 0;     Error *local_err = NULL;     PCIBus *root = pci_find_primary_bus();     if (!root) {         monitor_printf(mon, "no primary PCI bus (if there are multiple"     if (local_err) {         error_free(local_err);     Error *local_err = NULL;         return -1;     return 0;     unsigned slot;     PCIBus *root = pci_find_primary_bus();     return 0;     PCIBus *root = pci_find_primary_bus();     if (!root) {         monitor_printf(mon, "no primary PCI bus (if there are multiple" static int pci_device_hot_remove(Monitor *mon, const char *pci_addr)     PCIBus *root = pci_find_primary_bus();     PCIDevice *d;     int bus;     unsigned slot;     Error *local_err = NULL;     if (!root) {         monitor_printf(mon, "no primary PCI bus (if there are multiple"                        " PCI roots, you must use device_del instead)");         return -1;     if (pci_read_devaddr(mon, pci_addr, &bus, &slot)) {         return -1;     d = pci_find_device(root, bus, PCI_DEVFN(slot, 0));     if (!d) {         monitor_printf(mon, "slot %d empty\n", slot);         return -1;     qdev_unplug(&d->qdev, &local_err);     if (local_err) {         monitor_printf(mon, "%s\n", error_get_pretty(local_err));         error_free(local_err);         return -1;     return 0;
static int FUNC_0(Monitor *VAR_0, const char *VAR_1)

{

    PCIBus *root = pci_find_primary_bus();

    PCIDevice *d;

    int VAR_2;

    unsigned VAR_3;

    Error *local_err = NULL;



    if (!root) {

        monitor_printf(VAR_0, "no primary PCI VAR_2 (if there are multiple"

                       " PCI roots, you must use device_del instead)");

        return -1;

    }



    if (pci_read_devaddr(VAR_0, VAR_1, &VAR_2, &VAR_3)) {

        return -1;

    }



    d = pci_find_device(root, VAR_2, PCI_DEVFN(VAR_3, 0));

    if (!d) {

        monitor_printf(VAR_0, "VAR_3 %d empty\n", VAR_3);

        return -1;

    }



    qdev_unplug(&d->qdev, &local_err);

    if (local_err) {

        monitor_printf(VAR_0, "%s\n", error_get_pretty(local_err));

        error_free(local_err);

        return -1;

    }



    return 0;

}

static int FUNC_0(Monitor *VAR_0, const char *VAR_1)
{ PCIBus *root = pci_find_primary_bus(); PCIDevice *d; int VAR_2; unsigned VAR_3; Error *local_err = NULL; if (!root) { monitor_printf(VAR_0, "no primary PCI VAR_2 (if there are multiple"
" PCI roots, you must use device_del instead)"); return -1; } if (pci_read_devaddr(VAR_0, VAR_1, &VAR_2, &VAR_3)) { return -1; } d = pci_find_device(root, VAR_2, PCI_DEVFN(VAR_3, 0)); if (!d) { monitor_printf(VAR_0, "VAR_3 %d empty\n", VAR_3); return -1; } qdev_unplug(&d->qdev, &local_err); if (local_err) { monitor_printf(VAR_0, "%s\n", error_get_pretty(local_err)); error_free(local_err); return -1; } return 0; }