qemu: passt: Use 'reconnect-ms' instead of 'reconnect' with new qemus

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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2024-11-19 10:53:08 +01:00
parent 9e273db203
commit e4d058866e

View File

@ -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) {
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;