Finally, no more hacky sleep calls are left. Woohoo. This was already
effectively done by the previous commit, but now that I know it works,
I've removed the test path entirely
Simply a more convinent pipe. Additionally, because the pipe will only break when the process exits,
this means we can now remove QMP reconnection logic entirely. Can't exactly have problems
when the problem code is factored out ;)
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.
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.
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.
doesn't really need to be two seperate libraries. also preperation for other funnies
the build script has been replaced with a much saner justfile which uses much saner "yarn workspace" invocations instead of blindly cding all over the place