-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat : add writer implementation #39
base: main
Are you sure you want to change the base?
Conversation
ce43c8e
to
2cc0e25
Compare
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.
Could you describe what this feature is for?
This feature is used by the base-api team. In the actual implementation data written to serial port can only be send in stdout or in a file. |
b038585
to
12ff379
Compare
Either a UNIX socket or a named pipe could be used here (https://docs.google.com/presentation/d/1_GdTPlEw4aVCmBlrXdYbhrsmSOp0S_BsL5eAE9hSy1E/edit#slide=id.gcaea852e79_0_1929 and https://docs.google.com/presentation/d/1_GdTPlEw4aVCmBlrXdYbhrsmSOp0S_BsL5eAE9hSy1E/edit#slide=id.gcaea852e79_0_1924). If you pass a UNIX domain socket as the console path, then your receiving thread becomes a network server, a very well defined pattern. I strongly encourage you to go down that path instead of the one you're proposing here. |
src/vmm/src/lib.rs
Outdated
self.configure_console(console)?; | ||
self.configure_writer(writer); |
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.
So we're overwriting the console setting with a mpsc based Writer
? If I give a console path and a mpsc Sender, self serial will be set to the mpsc sender, afaiu.
src/vmm/src/devices/mod.rs
Outdated
self.tx | ||
.send(s.to_string()) | ||
.map_err(|_| std::io::Error::new(std::io::ErrorKind::Other, "Error sending data"))?; | ||
if buf.len() > 0 && (buf[0] != 10 && buf[0] != 13) { |
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.
What are 10 and 13?
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.
Why can't we send them?
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.
13 and 10 are non escaped line return and carriage return in unicode. We don't want them because it count like a character
in the protocol here : virt-do/lambdo#5
Signed-off-by: Simon LUCIDO <[email protected]>
Signed-off-by: Simon LUCIDO <[email protected]>
Signed-off-by: Simon LUCIDO <[email protected]>
Signed-off-by: Nils Ponsard <[email protected]>
Signed-off-by: Nils Ponsard <[email protected]>
Signed-off-by: Simon LUCIDO <[email protected]>
Signed-off-by: Simon LUCIDO <[email protected]>
Signed-off-by: Simon LUCIDO <[email protected]>
It is now possible to run a VM without a console with --no-console option Co-authored-by: Esteban Baron <[email protected]> Signed-off-by: Alexis Langlet <[email protected]>
Signed-off-by: Maxime <[email protected]>
We don't want to send new line (10) and carriage return (13) to the receiver. Signed-off-by: Maxime <[email protected]>
Signed-off-by: Maxime <[email protected]>
Signed-off-by: Maxime <[email protected]>
788acb7
to
dd57431
Compare
Hi,
Actually, we can't retrieve data that is send to serial port because they can only be send to stdout or in a file.
Writers implement the Write trait from std::io and send data to another thread through channel.
With writers we can run VM on one thread and retrieve data that is send to serial port on another thread to process it