Skip to content
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

Virtio console: Send bytes to the right queues #1002

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

jmezzacappa
Copy link
Contributor

@jmezzacappa jmezzacappa commented Mar 13, 2024

I discovered that all virtio console data was getting sent to the same port (/dev/hvc0) when doing something like this:

const encoder = new TextEncoder()
emulator.bus.send('virtio-console1-input-bytes', encoder.encode('hello world 1\n'))
emulator.bus.send('virtio-console2-input-bytes', encoder.encode('hello world 2\n'))
emulator.bus.send('virtio-console3-input-bytes', encoder.encode('hello world 3\n'))

When looking at the code, I noticed that the variable queue (the first one) is unused. I renamed it to queue_id (because there's another queue variable inside the event listener), plugged it into where it looked like it should go, and it worked :)

@copy copy merged commit 2bcfa9d into copy:master Mar 16, 2024
3 checks passed
@copy
Copy link
Owner

copy commented Mar 16, 2024

Thanks!

@basicer
Copy link
Contributor

basicer commented Apr 4, 2024

Woops! 🙃

@jmezzacappa
Copy link
Contributor Author

Woops! 🙃

You handled the hard parts :D The terminal feels faster and resizing is simpler to handle. Thanks for this feature!

@jmezzacappa jmezzacappa deleted the fix-virtio-console branch April 4, 2024 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants