On 2/22/23 01:35, Laine Stump wrote:
> If the passt process that implements the backend of a QEMU emulated
> network device terminates, QEMU itself is incapable of restarting a
> new process so that the networking can begin... working again.
>
> However, what QEMU can and does do is:
>
> 1) send the NETDEV_STREAM_DISCONNECTED event to libvirt when it sees
> that the socket has been closed (this event has been in QEMU for as
> long as support for "-netdev stream", which is used for connecting
> to passt)
>
> 2) as of QEMU 8.0.0, the qemu commandline for -netdev stream accepts
> the "reconnect" option, which tells QEMU to attempt reconnecting to
> the same socket it previously used, repeating the attempt every "n"
> seconds (the only argument to reconnect) until it is successful.
>
> If libvirt adds the reconnect option to the qemu commandline, and then
> responds to a NETDEV_STREAM_DISCONNECTED event by re-running the same
> passt command that it ran when the device was originally connected,
> then a guest will be able to recover in the (very unlikely, according
> to Stefano!) event that the original passt process unexpectedly exits,
> or is killed by some external entity.
>
> Patch 2/3 handles (2) above, while patch 3/3 handles (1). (patch 1/3
> is a short guest appearance by pkrempa. Thanks pkrempa!).
>
> This resolves https://bugzilla.redhat.com/2172098
>
> Along with Stefano's series fixing up selinux issues related to
> running the passt process, they make the passt backend very usable.
>
> Laine Stump (2):
> qemu: add reconnect=5 to passt qemu commandline options when available
> qemu: respond to NETDEV_STREAM_DISCONNECTED event
>
> Peter Krempa (1):
> qemu: capabilities: Introduce QEMU_CAPS_NETDEV_STREAM_RECONNECT
>
> src/qemu/qemu_capabilities.c | 4 +
> src/qemu/qemu_capabilities.h | 3 +
> src/qemu/qemu_domain.c | 1 +
> src/qemu/qemu_domain.h | 1 +
> src/qemu/qemu_driver.c | 82 +++++++++++++++++++
> src/qemu/qemu_monitor.c | 11 +++
> src/qemu/qemu_monitor.h | 6 ++
> src/qemu/qemu_monitor_json.c | 16 ++++
> src/qemu/qemu_passt.c | 11 +++
> src/qemu/qemu_process.c | 18 ++++
> .../caps_8.0.0.x86_64.xml | 1 +
> .../net-user-passt.x86_64-7.2.0.args | 37 +++++++++
> .../net-user-passt.x86_64-latest.args | 2 +-
> tests/qemuxml2argvtest.c | 1 +
> 14 files changed, 193 insertions(+), 1 deletion(-)
> create mode 100644 tests/qemuxml2argvdata/net-user-passt.x86_64-7.2.0.args
>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Michal