Virtiofsd panic when reaching max opened file descriptor.
Virtiofsd reports correctly "too many open files" to the guest until some value, after reaching this point it will just panic with the following message:
[...]
[2021-10-12T11:46:16Z DEBUG virtiofsd_rs] QUEUE_EVENT
thread 'vring_worker' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 24, kind: Uncategorized, message: "Too many open files"}', /virtiofsd-rs/src/passthrough/mod.rs:1261:59
I think the correct behavior would be to continue the error report to the guest while the guest OS tries to open file descriptors without panicking.
I didn't see any other error related to this limit in the debug logs. Reporting such OS error in the debug log might be interesting?
virtiofsd-rs was launched using the following parameters:
virtiofsd-rs --socket=/path/to/socket --shared-dir=/path/to/dir --cache=never --sandbox=chroot --log-level=debug 2> "$VIRTIOFSD_LOG"
The issue can be reproduced consistently every time on my setup, before hitting that limit everything works fine.
Edited by Pierre-Emmanuel Patry