virt-qemu: Work around #1072004 in 9pfs
Diagnosis on the upstream bug https://bugzilla.kernel.org/show_bug.cgi?id=218916 indicates that the size of the file is cached on the client side (in the guest VM), and reads stop at that size without polling the server (the host) for more data.
Until the proposed fix makes it into our kernels, it seems we can avoid this failure mode by stat'ing the file descriptor (in fact this ends up in the fstat() syscall) which invalidates a previously-cached size.
Thanks: Dominique Martinet
Closes: #1071456
Mitigates: #1072004
I've never really liked eofcat
, and in the long term I'd still like to migrate our qemu backend to be an autopkgtest-virt-ssh setup script that doesn't need to do tricky (and therefore unreliable) things with 9pfs, even if that makes it less efficient for very large packages; but in the meantime, if we can make eofcat
more robust, it will let us start testing on qemu again, which regressed when the 6.8.x kernel was uploaded to unstable in May 2024.
This worked for me on my laptop, but I'd like to have a positive test result from someone else before we merge this. Perhaps @elbrus or another CI team member would be able to try this on a ci.debian.net worker?