static CharDriverState *qemu_chr_open_tty(QemuOpts *opts)

{

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

    CharDriverState *chr;

    int fd;



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

    if (fd < 0) {

        return NULL;

    }

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

    chr = qemu_chr_open_fd(fd, fd);

    if (!chr) {

        close(fd);

        return NULL;

    }

    chr->chr_ioctl = tty_serial_ioctl;

    chr->chr_close = qemu_chr_close_tty;

    return chr;

}

static CharDriverState *qemu_chr_open_tty(QemuOpts *opts)

{

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

    CharDriverState *chr;

    int fd;



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

    if (fd < 0) {

        return NULL;

    }

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

    chr = qemu_chr_open_fd(fd, fd);

    if (!chr) {

        close(fd);

        return NULL;

    }

    chr->chr_ioctl = tty_serial_ioctl;

    chr->chr_close = qemu_chr_close_tty;

    return chr;

}

    TFR(fd = open(filename, O_RDWR | O_NONBLOCK));
static CharDriverState *FUNC_0(QemuOpts *opts)

{

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

    CharDriverState *chr;

    int VAR_1;



    TFR(VAR_1 = open(VAR_0, O_RDWR | O_NONBLOCK));

    if (VAR_1 < 0) {

        return NULL;

    }

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

    chr = qemu_chr_open_fd(VAR_1, VAR_1);

    if (!chr) {

        close(VAR_1);

        return NULL;

    }

    chr->chr_ioctl = tty_serial_ioctl;

    chr->chr_close = qemu_chr_close_tty;

    return chr;

}

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