For both bcvk ephemeral and bcvk libvirt run let's add --lifecycle-bind-to <pid> which would use pidfd_open and monitor that process' status, and when it exits we automatically exit as well.
The use case here is for things like test suites to replace code like this: https://github.com/bootc-dev/bootc/pull/1847/changes#diff-9b60649fe24ef1e3720f95723ad8b0da902c4c9d0071269e1958cdebadf4f157R39
A core problem with Drop impls in Rust (same with Go defer) is they don't get run on SIGINT (ctrl-c) by default and so really one gets pushed to doing cleanup in a more reliable way.
For both
bcvk ephemeralandbcvk libvirt runlet's add--lifecycle-bind-to <pid>which would usepidfd_openand monitor that process' status, and when it exits we automatically exit as well.The use case here is for things like test suites to replace code like this: https://github.com/bootc-dev/bootc/pull/1847/changes#diff-9b60649fe24ef1e3720f95723ad8b0da902c4c9d0071269e1958cdebadf4f157R39
A core problem with
Dropimpls in Rust (same with Godefer) is they don't get run on SIGINT (ctrl-c) by default and so really one gets pushed to doing cleanup in a more reliable way.