public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Laine Stump <laine@redhat.com>
To: libvir-list@redhat.com
Cc: passt-dev@passt.top
Subject: [libvirt PATCH 0/3] Support for restarting passt backend
Date: Tue, 21 Feb 2023 19:35:56 -0500	[thread overview]
Message-ID: <20230222003559.62442-1-laine@redhat.com> (raw)

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


             reply	other threads:[~2023-02-22  0:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22  0:35 Laine Stump [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230222003559.62442-1-laine@redhat.com \
    --to=laine@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).