int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data)

{

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

    VLANClientState *vc;



    vc = qemu_find_netdev(id);

    if (!vc || vc->info->type == NET_CLIENT_TYPE_NIC) {

        qerror_report(QERR_DEVICE_NOT_FOUND, id);

        return -1;

    }

    if (vc->peer) {

        qerror_report(QERR_DEVICE_IN_USE, id);

        return -1;

    }

    qemu_del_vlan_client(vc);

    qemu_opts_del(qemu_opts_find(&qemu_netdev_opts, id));

    return 0;

}

int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data)

{

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

    VLANClientState *vc;



    vc = qemu_find_netdev(id);

    if (!vc || vc->info->type == NET_CLIENT_TYPE_NIC) {

        qerror_report(QERR_DEVICE_NOT_FOUND, id);

        return -1;

    }

    if (vc->peer) {

        qerror_report(QERR_DEVICE_IN_USE, id);

        return -1;

    }

    qemu_del_vlan_client(vc);

    qemu_opts_del(qemu_opts_find(&qemu_netdev_opts, id));

    return 0;

}

int FUNC_0(Monitor *VAR_0, const QDict *VAR_1, QObject **VAR_2)

{

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

    VLANClientState *vc;



    vc = qemu_find_netdev(VAR_3);

    if (!vc || vc->info->type == NET_CLIENT_TYPE_NIC) {

        qerror_report(QERR_DEVICE_NOT_FOUND, VAR_3);

        return -1;

    }

    if (vc->peer) {

        qerror_report(QERR_DEVICE_IN_USE, VAR_3);

        return -1;

    }

    qemu_del_vlan_client(vc);

    qemu_opts_del(qemu_opts_find(&qemu_netdev_opts, VAR_3));

    return 0;

}

int FUNC_0(Monitor *VAR_0, const QDict *VAR_1, QObject **VAR_2)
{ const char *VAR_3 = qdict_get_str(VAR_1, "VAR_3"); VLANClientState *vc; vc = qemu_find_netdev(VAR_3); if (!vc || vc->info->type == NET_CLIENT_TYPE_NIC) { qerror_report(QERR_DEVICE_NOT_FOUND, VAR_3); return -1; } if (vc->peer) { qerror_report(QERR_DEVICE_IN_USE, VAR_3); return -1; } qemu_del_vlan_client(vc); qemu_opts_del(qemu_opts_find(&qemu_netdev_opts, VAR_3)); return 0; }