static int find_and_check_chardev(CharDriverState **chr,

                                  char *chr_name,

                                  Error **errp)

{

    CompareChardevProps props;



    *chr = qemu_chr_find(chr_name);

    if (*chr == NULL) {

        error_setg(errp, "Device '%s' not found",

                   chr_name);

        return 1;

    }



    memset(&props, 0, sizeof(props));

    if (qemu_opt_foreach((*chr)->opts, compare_chardev_opts, &props, errp)) {

        return 1;

    }



    if (!props.is_socket) {

        error_setg(errp, "chardev \"%s\" is not a tcp socket",

                   chr_name);

        return 1;

    }

    return 0;

}

static int find_and_check_chardev(CharDriverState **chr,

                                  char *chr_name,

                                  Error **errp)

{

    CompareChardevProps props;



    *chr = qemu_chr_find(chr_name);

    if (*chr == NULL) {

        error_setg(errp, "Device '%s' not found",

                   chr_name);

        return 1;

    }



    memset(&props, 0, sizeof(props));

    if (qemu_opt_foreach((*chr)->opts, compare_chardev_opts, &props, errp)) {

        return 1;

    }



    if (!props.is_socket) {

        error_setg(errp, "chardev \"%s\" is not a tcp socket",

                   chr_name);

        return 1;

    }

    return 0;

}

    if (qemu_opt_foreach((*chr)->opts, compare_chardev_opts, &props, errp)) {         return 1;     if (!props.is_socket) {         error_setg(errp, "chardev \"%s\" is not a tcp socket",                                   Error **errp)     return 0;     memset(&props, 0, sizeof(props));
static int FUNC_0(CharDriverState **VAR_0,

                                  char *VAR_1,

                                  Error **VAR_2)

{

    CompareChardevProps props;



    *VAR_0 = qemu_chr_find(VAR_1);

    if (*VAR_0 == NULL) {

        error_setg(VAR_2, "Device '%s' not found",

                   VAR_1);

        return 1;

    }



    memset(&props, 0, sizeof(props));

    if (qemu_opt_foreach((*VAR_0)->opts, compare_chardev_opts, &props, VAR_2)) {

        return 1;

    }



    if (!props.is_socket) {

        error_setg(VAR_2, "chardev \"%s\" is not a tcp socket",

                   VAR_1);

        return 1;

    }

    return 0;

}

static int FUNC_0(CharDriverState **VAR_0,
char *VAR_1,
Error **VAR_2)
{ CompareChardevProps props; *VAR_0 = qemu_chr_find(VAR_1); if (*VAR_0 == NULL) { error_setg(VAR_2, "Device '%s' not found",
VAR_1); return 1; } memset(&props, 0, sizeof(props)); if (qemu_opt_foreach((*VAR_0)->opts, compare_chardev_opts, &props, VAR_2)) { return 1; } if (!props.is_socket) { error_setg(VAR_2, "chardev \"%s\" is not a tcp socket",
VAR_1); return 1; } return 0; }