static int parse_netdev(DeviceState *dev, const char *str, void **ptr)
{
    NICPeers *peers_ptr = (NICPeers *)ptr;
    NICConf *conf = container_of(peers_ptr, NICConf, peers);
    NetClientState **ncs = peers_ptr->ncs;
    NetClientState *peers[MAX_QUEUE_NUM];
    int queues, i = 0;
    int ret;
    queues = qemu_find_net_clients_except(str, peers,
                                          NET_CLIENT_OPTIONS_KIND_NIC,
                                          MAX_QUEUE_NUM);
    if (queues == 0) {
        ret = -ENOENT;
    if (queues > MAX_QUEUE_NUM) {
        ret = -E2BIG;
    for (i = 0; i < queues; i++) {
        if (peers[i] == NULL) {
            ret = -ENOENT;
        if (peers[i]->peer) {
            ret = -EEXIST;
        ncs[i] = peers[i];
        ncs[i]->queue_index = i;
    conf->queues = queues;
    return 0;
err:
    return ret;
static int parse_netdev(DeviceState *dev, const char *str, void **ptr)
{
    NICPeers *peers_ptr = (NICPeers *)ptr;
    NICConf *conf = container_of(peers_ptr, NICConf, peers);
    NetClientState **ncs = peers_ptr->ncs;
    NetClientState *peers[MAX_QUEUE_NUM];
    int queues, i = 0;
    int ret;
    queues = qemu_find_net_clients_except(str, peers,
                                          NET_CLIENT_OPTIONS_KIND_NIC,
                                          MAX_QUEUE_NUM);
    if (queues == 0) {
        ret = -ENOENT;
    if (queues > MAX_QUEUE_NUM) {
        ret = -E2BIG;
    for (i = 0; i < queues; i++) {
        if (peers[i] == NULL) {
            ret = -ENOENT;
        if (peers[i]->peer) {
            ret = -EEXIST;
        ncs[i] = peers[i];
        ncs[i]->queue_index = i;
    conf->queues = queues;
    return 0;
err:
    return ret;
static int FUNC_0(DeviceState *VAR_0, const char *VAR_1, void **VAR_2)
{
    NICPeers *peers_ptr = (NICPeers *)VAR_2;
    NICConf *conf = container_of(peers_ptr, NICConf, peers);
    NetClientState **ncs = peers_ptr->ncs;
    NetClientState *peers[MAX_QUEUE_NUM];
    int VAR_3, VAR_4 = 0;
    int VAR_5;
    VAR_3 = qemu_find_net_clients_except(VAR_1, peers,
                                          NET_CLIENT_OPTIONS_KIND_NIC,
                                          MAX_QUEUE_NUM);
    if (VAR_3 == 0) {
        VAR_5 = -ENOENT;
    if (VAR_3 > MAX_QUEUE_NUM) {
        VAR_5 = -E2BIG;
    for (VAR_4 = 0; VAR_4 < VAR_3; VAR_4++) {
        if (peers[VAR_4] == NULL) {
            VAR_5 = -ENOENT;
        if (peers[VAR_4]->peer) {
            VAR_5 = -EEXIST;
        ncs[VAR_4] = peers[VAR_4];
        ncs[VAR_4]->queue_index = VAR_4;
    conf->VAR_3 = VAR_3;
    return 0;
err:
    return VAR_5;
static int FUNC_0(DeviceState *VAR_0, const char *VAR_1, void **VAR_2)
{ NICPeers *peers_ptr = (NICPeers *)VAR_2; NICConf *conf = container_of(peers_ptr, NICConf, peers); NetClientState **ncs = peers_ptr->ncs; NetClientState *peers[MAX_QUEUE_NUM]; int VAR_3, VAR_4 = 0; int VAR_5; VAR_3 = qemu_find_net_clients_except(VAR_1, peers,
NET_CLIENT_OPTIONS_KIND_NIC,
MAX_QUEUE_NUM); if (VAR_3 == 0) { VAR_5 = -ENOENT; if (VAR_3 > MAX_QUEUE_NUM) { VAR_5 = -E2BIG; for (VAR_4 = 0; VAR_4 < VAR_3; VAR_4++) { if (peers[VAR_4] == NULL) { VAR_5 = -ENOENT; if (peers[VAR_4]->peer) { VAR_5 = -EEXIST; ncs[VAR_4] = peers[VAR_4]; ncs[VAR_4]->queue_index = VAR_4; conf->VAR_3 = VAR_3; return 0; err:
return VAR_5;