Date: Wed, 19 Jun 2019 11:37:43 +0000 (UTC) From: Leandro Lupori <luporl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349188 - head/stand/ofw/libofw Message-ID: <201906191137.x5JBbh6k063222@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luporl Date: Wed Jun 19 11:37:43 2019 New Revision: 349188 URL: https://svnweb.freebsd.org/changeset/base/349188 Log: [PPC] Fix loader input with newer QEMU versions At least since version 4.0.0, QEMU became bug-compatible with PowerVM's vty, by inserting a \0 after every \r. As this confuses loader's interpreter and as a \0 coming from the console doesn't seem reasonable, it's now being filtered at OFW console input. Reviewed by: jhibbits MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20676 Modified: head/stand/ofw/libofw/ofw_console.c Modified: head/stand/ofw/libofw/ofw_console.c ============================================================================== --- head/stand/ofw/libofw/ofw_console.c Wed Jun 19 11:22:09 2019 (r349187) +++ head/stand/ofw/libofw/ofw_console.c Wed Jun 19 11:37:43 2019 (r349188) @@ -97,7 +97,11 @@ ofw_cons_getchar() return l; } - if (OF_read(stdin, &ch, 1) > 0) + /* At least since version 4.0.0, QEMU became bug-compatible + * with PowerVM's vty, by inserting a \0 after every \r. + * As this confuses loader's interpreter and as a \0 coming + * from the console doesn't seem reasonable, it's filtered here. */ + if (OF_read(stdin, &ch, 1) > 0 && ch != '\0') return (ch); return (-1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906191137.x5JBbh6k063222>