From e4d058866e9563756349de6b3f451a53e64ca872 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 19 Nov 2024 10:53:08 +0100 Subject: [PATCH] qemu: passt: Use 'reconnect-ms' instead of 'reconnect' with new qemus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'reconnect' field of 'stream' network backend type is about to be deprecated so libvirt will need to start using 'reconnect-ms'. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_passt.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c index 70a12c825e..dd4a8bb997 100644 --- a/src/qemu/qemu_passt.c +++ b/src/qemu/qemu_passt.c @@ -104,12 +104,14 @@ qemuPasstAddNetProps(virDomainObj *vm, return -1; } - /* a narrow range of QEMU releases support -netdev stream, but - * don't support its "reconnect" option - */ - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM_RECONNECT) && - virJSONValueObjectAdd(netprops, "u:reconnect", 5, NULL) < 0) { - 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", 5000, NULL) < 0) + return -1; + } else { + if (virJSONValueObjectAdd(netprops, "u:reconnect", 5, NULL) < 0) + return -1; + } } return 0;