Commit Graph

15 Commits

Author SHA1 Message Date
modeco80
ddf4d97511 qemu: more refactoring
qmp client is now much more robust (and doesn't fight over itself as much). this should
hopefully completely eliminate the case where display connects but qmp is half connected.

i also forgot QemuDisplay actually emits an event on connection, so we can just use that to
wait for when the display connects. which allows us to set the started state there instead of praying
when the qmp client connects that we are connected to the display roughly at the same time.

i also gated some stuff to require vm state in the server. this is a bit rickity, but does seem to work.
2024-07-11 20:33:50 -04:00
modeco80
7423c62957 re-add magic timeouts
also remove a problematic line that broke more than it helped
2024-07-11 03:39:00 -04:00
modeco80
25b32b23b7 qemu: More fun refactoring
The QMP client has been refactored slightly, mostly just to clean up its
edges slightly.

QemuVM however has seen a big refactor, especially connecting to QMP.
Flattening out this logic is something I should have done a long time ago.

This seemingly has finally hammered out the bugs, although time will tell.
2024-07-11 03:24:22 -04:00
modeco80
0b59c6d8be QMP client now buffers lines properly 2024-07-11 02:29:26 -04:00
modeco80
227a171110 qemu: Completely rewrite QMP client from scratch
It sucked. The new one is using Sans I/O principles, so it does not
directly do I/O or talk to a net.Socket directly (instead, QemuVM implements
the layer to do I/O). This means in the future this library could actually
be tested, but for now, I'm not bothering with that.

There's also some other cleanups that were bothering me.
2024-07-10 22:20:12 -04:00
modeco80
048f08b00b actually make vm swich displays properly or whatever 2024-07-10 18:43:35 -04:00
modeco80
8369de53ba qemu: log QEMU stderr as logger messages
Mostly for nicity, but also to make debugging start errors an actual possibility.
2024-06-23 02:56:17 -04:00
modeco80
0df56cb5a4 qemu: cleanup/fix reset 2024-06-23 02:40:13 -04:00
modeco80
39521a4b1d misc stuff from production
(also refactors qemu a bit)
2024-06-19 23:30:29 -04:00
modeco80
0d34bb1c8e cvmts/qemu: support snapshots properly 2024-06-19 18:03:10 -04:00
Elijah R
794b801628 add VNCVM 2024-06-11 13:46:24 -04:00
modeco80
e184bfb085 qemu: fix qmp disconnection semi properly
this is actually something i need to push to crusttest as well, because
this will affect it as well, though not as badly because it will only break certain buttons
2024-05-22 17:56:04 -04:00
modeco80
a904f26961 abstract jpeg encoding away from "WSServer"
Additionally make thumbnail encoding threadpooled as well, just so it (probably) doesn't block as much.
2024-04-24 04:18:05 -04:00
modeco80
ddae307874 chore: reformat all code with prettier 2024-04-24 03:50:17 -04:00
modeco80
cb297e15c4 Giant refactoring (or at least the start)
In short:
- cvmts is now bundled/built via parcel and inside of a npm/yarn workspace with multiple nodejs projects
- cvmts now uses the crusttest QEMU management and RFB library (or a fork, if you so prefer).
- cvmts does NOT use node-canvas anymore, instead we opt for the same route crusttest took and just encode jpegs ourselves from the RFB provoded framebuffer via jpeg-turbo. this means funnily enough sharp is back for more for thumbnails, but actually seems to WORK this time
- IPData is now managed in a very similar way to the original cvm 1.2 implementation where a central manager and reference count exist. tbh it wouldn't be that hard to implement multinode either, but for now, I'm not going to take much time on doing that.

this refactor is still incomplete. please do not treat it as generally available while it's not on the default branch. if you want to use it (and report bugs or send fixes) feel free to, but while it may "just work" in certain situations it may be very broken in others.

(yes, I know windows support is partially totaled by this; it's something that can and will be fixed)
2024-04-23 09:57:02 -04:00