public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [libvirt PATCH 0/3] Support for restarting passt backend
@ 2023-02-22  0:35 Laine Stump
  2023-02-22  0:35 ` [libvirt PATCH 1/3] qemu: capabilities: Introduce QEMU_CAPS_NETDEV_STREAM_RECONNECT Laine Stump
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Laine Stump @ 2023-02-22  0:35 UTC (permalink / raw)
  To: libvir-list; +Cc: passt-dev

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

-- 
2.39.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-02-22 13:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22  0:35 [libvirt PATCH 0/3] Support for restarting passt backend Laine Stump
2023-02-22  0:35 ` [libvirt PATCH 1/3] qemu: capabilities: Introduce QEMU_CAPS_NETDEV_STREAM_RECONNECT Laine Stump
2023-02-22  0:35 ` [libvirt PATCH 2/3] qemu: add reconnect=5 to passt qemu commandline options when available Laine Stump
2023-02-22  0:35 ` [libvirt PATCH 3/3] qemu: respond to NETDEV_STREAM_DISCONNECTED event Laine Stump
2023-02-22 10:21   ` Michal Prívozník
2023-02-22 13:30     ` Laine Stump
2023-02-22 10:21 ` [libvirt PATCH 0/3] Support for restarting passt backend Michal Prívozník

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).