]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: add reconnect=5 to passt qemu commandline options when available
authorLaine Stump <laine@redhat.com>
Mon, 20 Feb 2023 23:26:51 +0000 (18:26 -0500)
committerLaine Stump <laine@redhat.com>
Wed, 22 Feb 2023 13:26:01 +0000 (08:26 -0500)
commitacd8333f763f1e45728fac4e727fef4e33141ebf
tree8dac4ecab493b597ed1c868fe17708622c74a132
parent70747222a73ffed5cdadcab492bef67fe7e49aa4
qemu: add reconnect=5 to passt qemu commandline options when available

QEMU's "reconnect" option of "-netdev stream" tells QEMU to
periodically (period is given in seconds as an argument to the option)
attempt to reconnect to the same passt socket to which it had
originally connected to. This is useful in cases where the passt
process terminates, and libvirtd starts a new passt process in its
place (which doesn't happen yet, but will happen automatically after
an upcoming patch in this series).

Since there is no real hueristic for determining the "best" value of
the reconnect interval, rather than clutter up config with a knob that
nobody knows how to properly twiddle, we just set the reconnect timer
to 5 seconds.

"-netdev stream" first appeared in QEMU 7.2.0, but the reconnect
option won't be available until QEMU 8.0.0, so we need to check QEMU
capabilities just in case someone is using QEMU 7.2.0 (and thus can
support passt backend, but not reconnect)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_passt.c
tests/qemuxml2argvdata/net-user-passt.x86_64-7.2.0.args [new file with mode: 0644]
tests/qemuxml2argvdata/net-user-passt.x86_64-latest.args
tests/qemuxml2argvtest.c