int net_init_vhost_user(const NetClientOptions *opts, const char *name,

                        NetClientState *peer, Error **errp)

{

    const NetdevVhostUserOptions *vhost_user_opts;

    CharDriverState *chr;



    assert(opts->kind == NET_CLIENT_OPTIONS_KIND_VHOST_USER);

    vhost_user_opts = opts->vhost_user;



    chr = net_vhost_parse_chardev(vhost_user_opts, errp);

    if (!chr) {

        return -1;

    }



    /* verify net frontend */

    if (qemu_opts_foreach(qemu_find_opts("device"), net_vhost_check_net,

                          (char *)name, errp)) {

        return -1;

    }





    return net_vhost_user_init(peer, "vhost_user", name, chr);

}

int net_init_vhost_user(const NetClientOptions *opts, const char *name,

                        NetClientState *peer, Error **errp)

{

    const NetdevVhostUserOptions *vhost_user_opts;

    CharDriverState *chr;



    assert(opts->kind == NET_CLIENT_OPTIONS_KIND_VHOST_USER);

    vhost_user_opts = opts->vhost_user;



    chr = net_vhost_parse_chardev(vhost_user_opts, errp);

    if (!chr) {

        return -1;

    }



    

    if (qemu_opts_foreach(qemu_find_opts("device"), net_vhost_check_net,

                          (char *)name, errp)) {

        return -1;

    }





    return net_vhost_user_init(peer, "vhost_user", name, chr);

}

int FUNC_0(const NetClientOptions *VAR_0, const char *VAR_1,

                        NetClientState *VAR_2, Error **VAR_3)

{

    const NetdevVhostUserOptions *VAR_4;

    CharDriverState *chr;



    assert(VAR_0->kind == NET_CLIENT_OPTIONS_KIND_VHOST_USER);

    VAR_4 = VAR_0->vhost_user;



    chr = net_vhost_parse_chardev(VAR_4, VAR_3);

    if (!chr) {

        return -1;

    }



    

    if (qemu_opts_foreach(qemu_find_opts("device"), net_vhost_check_net,

                          (char *)VAR_1, VAR_3)) {

        return -1;

    }





    return net_vhost_user_init(VAR_2, "vhost_user", VAR_1, chr);

}

int FUNC_0(const NetClientOptions *VAR_0, const char *VAR_1,
NetClientState *VAR_2, Error **VAR_3)
{ const NetdevVhostUserOptions *VAR_4; CharDriverState *chr; assert(VAR_0->kind == NET_CLIENT_OPTIONS_KIND_VHOST_USER); VAR_4 = VAR_0->vhost_user; chr = net_vhost_parse_chardev(VAR_4, VAR_3); if (!chr) { return -1; } if (qemu_opts_foreach(qemu_find_opts("device"), net_vhost_check_net,
(char *)VAR_1, VAR_3)) { return -1; } return net_vhost_user_init(VAR_2, "vhost_user", VAR_1, chr); }