From: Peter Krempa Date: Mon, 3 Nov 2025 12:23:48 +0000 (+0100) Subject: qemu: capabilities: Fix logic for formatting 'reconnect' parameter X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed0f48935285c99bc374420c8c0cee927527334c;p=thirdparty%2Flibvirt.git qemu: capabilities: Fix logic for formatting 'reconnect' parameter In commit e4d058866e9 I've converted the code to use the modern 'reconnect-ms' parameter instead of 'reconnect' but messed up the logic for the time when 'reconnect' will be removed. We need to check QEMU_CAPS_NETDEV_STREAM_RECONNECT_MILISECONDS individually and not based on QEMU_CAPS_NETDEV_STREAM_RECONNECT. Fix the logic as upstream qemu now removed 'reconnect'. Fixes: e4d058866e9563756349de6b3f451a53e64ca872 Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c index fcec2ed76b..520eb1244a 100644 --- a/src/qemu/qemu_passt.c +++ b/src/qemu/qemu_passt.c @@ -104,17 +104,15 @@ qemuPasstAddNetProps(virDomainObj *vm, return -1; } - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM_RECONNECT)) { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM_RECONNECT_MILISECONDS)) { - if (virJSONValueObjectAdd(netprops, "u:reconnect-ms", - QEMU_PASST_RECONNECT_TIMEOUT * 1000, NULL) < 0) { - return -1; - } - } else { - if (virJSONValueObjectAdd(netprops, "u:reconnect", - QEMU_PASST_RECONNECT_TIMEOUT, NULL) < 0) { - return -1; - } + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM_RECONNECT_MILISECONDS)) { + if (virJSONValueObjectAdd(netprops, "u:reconnect-ms", + QEMU_PASST_RECONNECT_TIMEOUT * 1000, NULL) < 0) { + return -1; + } + } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM_RECONNECT)) { + if (virJSONValueObjectAdd(netprops, "u:reconnect", + QEMU_PASST_RECONNECT_TIMEOUT, NULL) < 0) { + return -1; } }