void hmp_drive_add(Monitor *mon, const QDict *qdict)

{

    DriveInfo *dinfo = NULL;

    const char *opts = qdict_get_str(qdict, "opts");



    dinfo = add_init_drive(opts);

    if (!dinfo) {

        goto err;

    }

    if (dinfo->devaddr) {

        monitor_printf(mon, "Parameter addr not supported\n");

        goto err;

    }



    switch (dinfo->type) {

    case IF_NONE:

        monitor_printf(mon, "OK\n");

        break;

    default:

        if (pci_drive_hot_add(mon, qdict, dinfo)) {

            goto err;

        }

    }

    return;



err:

    if (dinfo) {

        blk_unref(blk_by_legacy_dinfo(dinfo));

    }

}

void hmp_drive_add(Monitor *mon, const QDict *qdict)

{

    DriveInfo *dinfo = NULL;

    const char *opts = qdict_get_str(qdict, "opts");



    dinfo = add_init_drive(opts);

    if (!dinfo) {

        goto err;

    }

    if (dinfo->devaddr) {

        monitor_printf(mon, "Parameter addr not supported\n");

        goto err;

    }



    switch (dinfo->type) {

    case IF_NONE:

        monitor_printf(mon, "OK\n");

        break;

    default:

        if (pci_drive_hot_add(mon, qdict, dinfo)) {

            goto err;

        }

    }

    return;



err:

    if (dinfo) {

        blk_unref(blk_by_legacy_dinfo(dinfo));

    }

}

        if (pci_drive_hot_add(mon, qdict, dinfo)) {             goto err;         monitor_printf(mon, "Parameter addr not supported\n");     switch (dinfo->type) {             goto err;             goto err;             goto err;             goto err;         break;     default:         goto err; err:     DriveInfo *dinfo = NULL;         break;         break;     default:
void FUNC_0(Monitor *VAR_0, const QDict *VAR_1)

{

    DriveInfo *dinfo = NULL;

    const char *VAR_2 = qdict_get_str(VAR_1, "VAR_2");



    dinfo = add_init_drive(VAR_2);

    if (!dinfo) {

        goto err;

    }

    if (dinfo->devaddr) {

        monitor_printf(VAR_0, "Parameter addr not supported\n");

        goto err;

    }



    switch (dinfo->type) {

    case IF_NONE:

        monitor_printf(VAR_0, "OK\n");

        break;

    default:

        if (pci_drive_hot_add(VAR_0, VAR_1, dinfo)) {

            goto err;

        }

    }

    return;



err:

    if (dinfo) {

        blk_unref(blk_by_legacy_dinfo(dinfo));

    }

}

void FUNC_0(Monitor *VAR_0, const QDict *VAR_1)
{ DriveInfo *dinfo = NULL; const char *VAR_2 = qdict_get_str(VAR_1, "VAR_2"); dinfo = add_init_drive(VAR_2); if (!dinfo) { goto err; } if (dinfo->devaddr) { monitor_printf(VAR_0, "Parameter addr not supported\n"); goto err; } switch (dinfo->type) { case IF_NONE:
monitor_printf(VAR_0, "OK\n"); break; default:
if (pci_drive_hot_add(VAR_0, VAR_1, dinfo)) { goto err; } } return; err:
if (dinfo) { blk_unref(blk_by_legacy_dinfo(dinfo)); } }