static int qemu_chr_open_tty(QemuOpts *opts, CharDriverState **_chr)

{

    const char *filename = qemu_opt_get(opts, "path");

    CharDriverState *chr;

    int fd;



    TFR(fd = qemu_open(filename, O_RDWR | O_NONBLOCK));

    if (fd < 0) {

        return -errno;

    }

    tty_serial_init(fd, 115200, 'N', 8, 1);

    chr = qemu_chr_open_fd(fd, fd);

    chr->chr_ioctl = tty_serial_ioctl;

    chr->chr_close = qemu_chr_close_tty;



    *_chr = chr;

    return 0;

}

static int qemu_chr_open_tty(QemuOpts *opts, CharDriverState **_chr)

{

    const char *filename = qemu_opt_get(opts, "path");

    CharDriverState *chr;

    int fd;



    TFR(fd = qemu_open(filename, O_RDWR | O_NONBLOCK));

    if (fd < 0) {

        return -errno;

    }

    tty_serial_init(fd, 115200, 'N', 8, 1);

    chr = qemu_chr_open_fd(fd, fd);

    chr->chr_ioctl = tty_serial_ioctl;

    chr->chr_close = qemu_chr_close_tty;



    *_chr = chr;

    return 0;

}

    *_chr = chr;     return 0;     *_chr = chr;     return 0;     *_chr = chr;     return 0;     return 0;         return -errno;     return 0;     return 0;     *_chr = chr;     return 0;         return -errno;     *_chr = chr;     return 0; static int qemu_chr_open_tty(QemuOpts *opts, CharDriverState **_chr)     TFR(fd = qemu_open(filename, O_RDWR | O_NONBLOCK));         return -errno;     *_chr = chr;     return 0;     if (fd < 0) {         return -errno;         return -errno;     *_chr = chr;     return 0;     if (fd < 0) {         return -errno;     *_chr = chr;     return 0;     *_chr = chr;     return 0;     *_chr = chr;     return 0;     return 0;     *_chr = chr;     return 0;     *_chr = chr;     return 0;     if (fd < 0) {     *_chr = chr;     return 0;     *_chr = chr;     return 0;
static int FUNC_0(QemuOpts *VAR_0, CharDriverState **VAR_1)

{

    const char *VAR_2 = qemu_opt_get(VAR_0, "path");

    CharDriverState *chr;

    int VAR_3;



    TFR(VAR_3 = qemu_open(VAR_2, O_RDWR | O_NONBLOCK));

    if (VAR_3 < 0) {

        return -errno;

    }

    tty_serial_init(VAR_3, 115200, 'N', 8, 1);

    chr = qemu_chr_open_fd(VAR_3, VAR_3);

    chr->chr_ioctl = tty_serial_ioctl;

    chr->chr_close = qemu_chr_close_tty;



    *VAR_1 = chr;

    return 0;

}

static int FUNC_0(QemuOpts *VAR_0, CharDriverState **VAR_1)
{ const char *VAR_2 = qemu_opt_get(VAR_0, "path"); CharDriverState *chr; int VAR_3; TFR(VAR_3 = qemu_open(VAR_2, O_RDWR | O_NONBLOCK)); if (VAR_3 < 0) { return -errno; } tty_serial_init(VAR_3, 115200, 'N', 8, 1); chr = qemu_chr_open_fd(VAR_3, VAR_3); chr->chr_ioctl = tty_serial_ioctl; chr->chr_close = qemu_chr_close_tty; *VAR_1 = chr; return 0; }