From: Peter Krempa <pkrempa@redhat.com>
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 <pkrempa@redhat.com>
---
src/qemu/qemu_passt.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
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;
}
}
--
2.51.0