An interesting week. Didn't go quite in the direction I expected it to. Documentation ------------- Cole kindly provided[1] some documentation[2] for spectrum-vm for the developer manual. This was especially nice, because it marked the first time I was able to remove[3] an item from the Contribution Ideas page[4] because somebody had done the contribution! Thanks Cole! [1]: https://spectrum-os.org/lists/archives/spectrum-devel/87zh97coks.fsf@alyssa.is/T/#t [2]: https://spectrum-os.org/doc/developer-manual.html#_spectrum_vm [3]: https://spectrum-os.org/git/www/commit/?id=bf7cde0ddd06455f212fb39092b87313cee8a7c1 [4]: https://spectrum-os.org/todo.html crosvm ------ My main goal for this week was to start modifying libwayland-server to use a virtio_wl socket as the display socket, as described last week[5]. So, in pursuit of this goal, I started the week by trying to write a test program that would start a VM running a compositor, create a socket, attach one end to that VM, and then start another VM running a Wayland client, and attach the other end of the socket to that VM. Then, in theory, all I had to do was the libwayland-server modifications, and then the compositor and client would be able to talk to each other. Unfortunately, I didn't get that far. The program froze after starting the first VM. I assumed I must have done something wrong, so I rewrote it, and had the same problem. I did it again, and same problem. Some further debugging revealed that the command to add the socket to the first VM was hanging. And also, crosvm was hanging. Running the command outside this program worked fine, though. It returned immediately, and crosvm kept running with the new socket added. What I eventually realised was that the crosvm hang only happened if the command was sent to it early enough. After some intense staring at the crosvm code, I realised that there was a deadlock resulting from trying to wait for a response from a virtual device before the device had been initialized. Despite this issue manifesting with adding Wayland sockets, which is a feature unique to crosvm, a lot of the code for that is adapted from the code for resizing virtual block devices, which is an upstream feature. And that had the same issue, so this is actually an upstream bug. The fix was not easy, and required some fairly substantial refactoring. It's described in detail in the patch message[6]. I think it's probably a pretty interesting read. I also merged in the latest upstream crosvm changes. [5]: https://spectrum-os.org/lists/archives/spectrum-discuss/87tuzm287b.fsf@alyssa.is/ [6]: https://spectrum-os.org/lists/archives/spectrum-devel/20200614114344.22642-3-hi@alyssa.is/ Nixpkgs ------- I spent a few more hours trying to get libvda (an optional dependency of crosvm; required for virtio-video) to build, and I got it to work, thanks to some help from Puck. There's still a hack in there I'll tidy up before I push it, but it's cool to have this packaged for future experimentation with this crosvm feature. With the crosvm issue out of the way, which ended up taking most of the week to identify and fix, hopefully next week I'll be able to actually get going on those libwayland-server changes.