static void attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt,
                   int fdt_start_offset, bool coldplug, Error **errp)
{
    DPRINTFN("drc: %x, attach", get_index(drc));
    if (drc->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) {
        error_setg(errp, "an attached device is still awaiting release");
        return;
    if (drc->type == SPAPR_DR_CONNECTOR_TYPE_PCI) {
        g_assert(drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_USABLE);
    g_assert(fdt || coldplug);
    /* NOTE: setting initial isolation state to UNISOLATED means we can't
     * detach unless guest has a userspace/kernel that moves this state
     * back to ISOLATED in response to an unplug event, or this is done
     * manually by the admin prior. if we force things while the guest
     * may be accessing the device, we can easily crash the guest, so we
     * we defer completion of removal in such cases to the reset() hook.
     */
    if (drc->type == SPAPR_DR_CONNECTOR_TYPE_PCI) {
        drc->isolation_state = SPAPR_DR_ISOLATION_STATE_UNISOLATED;
    drc->indicator_state = SPAPR_DR_INDICATOR_STATE_ACTIVE;
    drc->dev = d;
    drc->fdt = fdt;
    drc->fdt_start_offset = fdt_start_offset;
    drc->configured = coldplug;
    /* 'logical' DR resources such as memory/cpus are in some cases treated
     * as a pool of resources from which the guest is free to choose from
     * based on only a count. for resources that can be assigned in this
     * fashion, we must assume the resource is signalled immediately
     * since a single hotplug request might make an arbitrary number of
     * such attached resources available to the guest, as opposed to
     * 'physical' DR resources such as PCI where each device/resource is
     * signalled individually.
     */
    drc->signalled = (drc->type != SPAPR_DR_CONNECTOR_TYPE_PCI)
                     ? true : coldplug;
    object_property_add_link(OBJECT(drc), "device",
                             object_get_typename(OBJECT(drc->dev)),
                             (Object **)(&drc->dev),
                             NULL, 0, NULL);
static void attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt,
                   int fdt_start_offset, bool coldplug, Error **errp)
{
    DPRINTFN("drc: %x, attach", get_index(drc));
    if (drc->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) {
        error_setg(errp, "an attached device is still awaiting release");
        return;
    if (drc->type == SPAPR_DR_CONNECTOR_TYPE_PCI) {
        g_assert(drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_USABLE);
    g_assert(fdt || coldplug);
    






    if (drc->type == SPAPR_DR_CONNECTOR_TYPE_PCI) {
        drc->isolation_state = SPAPR_DR_ISOLATION_STATE_UNISOLATED;
    drc->indicator_state = SPAPR_DR_INDICATOR_STATE_ACTIVE;
    drc->dev = d;
    drc->fdt = fdt;
    drc->fdt_start_offset = fdt_start_offset;
    drc->configured = coldplug;
    








    drc->signalled = (drc->type != SPAPR_DR_CONNECTOR_TYPE_PCI)
                     ? true : coldplug;
    object_property_add_link(OBJECT(drc), "device",
                             object_get_typename(OBJECT(drc->dev)),
                             (Object **)(&drc->dev),
                             NULL, 0, NULL);
static void FUNC_0(sPAPRDRConnector *VAR_0, DeviceState *VAR_1, void *VAR_2,
                   int VAR_3, bool VAR_4, Error **VAR_5)
{
    DPRINTFN("VAR_0: %x, FUNC_0", get_index(VAR_0));
    if (VAR_0->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) {
        error_setg(VAR_5, "an attached device is still awaiting release");
        return;
    if (VAR_0->type == SPAPR_DR_CONNECTOR_TYPE_PCI) {
        g_assert(VAR_0->allocation_state == SPAPR_DR_ALLOCATION_STATE_USABLE);
    g_assert(VAR_2 || VAR_4);
    






    if (VAR_0->type == SPAPR_DR_CONNECTOR_TYPE_PCI) {
        VAR_0->isolation_state = SPAPR_DR_ISOLATION_STATE_UNISOLATED;
    VAR_0->indicator_state = SPAPR_DR_INDICATOR_STATE_ACTIVE;
    VAR_0->dev = VAR_1;
    VAR_0->VAR_2 = VAR_2;
    VAR_0->VAR_3 = VAR_3;
    VAR_0->configured = VAR_4;
    








    VAR_0->signalled = (VAR_0->type != SPAPR_DR_CONNECTOR_TYPE_PCI)
                     ? true : VAR_4;
    object_property_add_link(OBJECT(VAR_0), "device",
                             object_get_typename(OBJECT(VAR_0->dev)),
                             (Object **)(&VAR_0->dev),
                             NULL, 0, NULL);
static void FUNC_0(sPAPRDRConnector *VAR_0, DeviceState *VAR_1, void *VAR_2,
int VAR_3, bool VAR_4, Error **VAR_5)
{ DPRINTFN("VAR_0: %x, FUNC_0", get_index(VAR_0)); if (VAR_0->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) { error_setg(VAR_5, "an attached device is still awaiting release"); return; if (VAR_0->type == SPAPR_DR_CONNECTOR_TYPE_PCI) { g_assert(VAR_0->allocation_state == SPAPR_DR_ALLOCATION_STATE_USABLE); g_assert(VAR_2 || VAR_4); if (VAR_0->type == SPAPR_DR_CONNECTOR_TYPE_PCI) { VAR_0->isolation_state = SPAPR_DR_ISOLATION_STATE_UNISOLATED; VAR_0->indicator_state = SPAPR_DR_INDICATOR_STATE_ACTIVE; VAR_0->dev = VAR_1; VAR_0->VAR_2 = VAR_2; VAR_0->VAR_3 = VAR_3; VAR_0->configured = VAR_4; VAR_0->signalled = (VAR_0->type != SPAPR_DR_CONNECTOR_TYPE_PCI)
? true : VAR_4; object_property_add_link(OBJECT(VAR_0), "device",
object_get_typename(OBJECT(VAR_0->dev)),
(Object **)(&VAR_0->dev),
NULL, 0, NULL);