-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xen console: update the "to be written" count #538
Conversation
2935f9c
to
ae02183
Compare
ae02183
to
099be86
Compare
looks fine to me, a regression test could be added here in the solo5 test suite (the behaviour should be reproducible without any mirageos / ocaml involved). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix looks right to me. If anyone has some time, a 'console stress test' would be a useful regression test to have for all the backends.
Thanks, the test is done by @hannesm, I will cut a release. |
Previously we can get an infinite loop as
written
is the number of bytes written to the console returned byconsole_write_some
(from 0 to itslen
argument) (l111), then it's compared against len for teminating the loop (l126).The issue is that if
len
is greater than the Xen buffer size (2048B), we have to loop over the buffer and useconsole_write_some
more than one time (and it will return something in the interval[0,len-written[
which will never equalslen
(l126).The proposed patch
lower theincrease the written count until it reacheslen
which will stand for "how many bytes I still have to write", and stops the loop when it comes to 0len
. This fix #537.