[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] xen/console: Simplify domU console handling in guest_console_write
commit f7efd9c792738f579e3c7062d8d3e90b21d8a771 Author: Julien Grall <julien.grall@xxxxxxx> AuthorDate: Tue Apr 2 15:30:21 2019 +0100 Commit: Julien Grall <julien.grall@xxxxxxx> CommitDate: Fri Aug 16 22:44:34 2019 +0100 xen/console: Simplify domU console handling in guest_console_write 2 paths in the domU console handling are now the same. So they can be merged to make the code simpler. Signed-off-by: Julien Grall <julien.grall@xxxxxxx> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- xen/drivers/char/console.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index f6913b9f46..2c14c2ca73 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -585,13 +585,8 @@ static long guest_console_write(XEN_GUEST_HANDLE_PARAM(char) buffer, *kout = '\0'; spin_lock(&cd->pbuf_lock); kcount = kin - kbuf; - if ( c == '\n' ) - { - cd->pbuf[cd->pbuf_idx] = '\0'; - guest_printk(cd, XENLOG_G_DEBUG "%s%s\n", cd->pbuf, kbuf); - cd->pbuf_idx = 0; - } - else if ( cd->pbuf_idx + (kout - kbuf) < (DOMAIN_PBUF_SIZE - 1) ) + if ( c != '\n' && + (cd->pbuf_idx + (kout - kbuf) < (DOMAIN_PBUF_SIZE - 1)) ) { /* buffer the output until a newline */ memcpy(cd->pbuf + cd->pbuf_idx, kbuf, kout - kbuf); -- generated by git-patchbot for /home/xen/git/xen.git#staging _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |