/* Validate any options which have a dependency on address type */
switch (addr->type) {
case SOCKET_ADDRESS_TYPE_FD:
- if (sock->has_reconnect) {
+ if (sock->has_reconnect_ms) {
error_setg(errp,
- "'reconnect' option is incompatible with "
+ "'reconnect-ms' option is incompatible with "
"'fd' address type");
return false;
}
/* Validate any options which have a dependency on client vs server */
if (!sock->has_server || sock->server) {
- if (sock->has_reconnect) {
+ if (sock->has_reconnect_ms) {
error_setg(errp,
- "'reconnect' option is incompatible with "
+ "'reconnect-ms' option is incompatible with "
"socket in server listen mode");
return false;
}
}
}
- if (sock->has_reconnect_ms && sock->has_reconnect) {
- error_setg(errp,
- "'reconnect' and 'reconnect-ms' are mutually exclusive");
- return false;
- }
-
return true;
}
bool is_tn3270 = sock->has_tn3270 ? sock->tn3270 : false;
bool is_waitconnect = sock->has_wait ? sock->wait : false;
bool is_websock = sock->has_websocket ? sock->websocket : false;
- int64_t reconnect_ms = 0;
+ int64_t reconnect_ms = sock->has_reconnect_ms ? sock->reconnect_ms : 0;
SocketAddress *addr;
s->is_listen = is_listen;
return;
}
} else {
- if (sock->has_reconnect) {
- reconnect_ms = sock->reconnect * 1000ULL;
- } else if (sock->has_reconnect_ms) {
- reconnect_ms = sock->reconnect_ms;
- }
-
if (qmp_chardev_open_socket_client(chr, reconnect_ms, errp) < 0) {
return;
}
*/
sock->has_wait = qemu_opt_find(opts, "wait") || sock->server;
sock->wait = qemu_opt_get_bool(opts, "wait", true);
- sock->has_reconnect = qemu_opt_find(opts, "reconnect");
- sock->reconnect = qemu_opt_get_number(opts, "reconnect", 0);
sock->has_reconnect_ms = qemu_opt_find(opts, "reconnect-ms");
sock->reconnect_ms = qemu_opt_get_number(opts, "reconnect-ms", 0);
(to be in sync with the renaming of the corresponding command line
option).
+Device options
+--------------
+
+Character device options
+''''''''''''''''''''''''
+
+``reconnect`` (removed in 10.2)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The ``reconnect`` has been replaced by ``reconnect-ms``, which provides
+better precision.
+
.. _Intel discontinuance notification: https://www.intel.com/content/www/us/en/content-details/781327/intel-is-discontinuing-ip-ordering-codes-listed-in-pdn2312-for-nios-ii-ip.html
# @websocket: enable websocket protocol on server sockets
# (default: false) (Since: 3.1)
#
-# @reconnect: For a client socket, if a socket is disconnected, then
-# attempt a reconnect after the given number of seconds. Setting
-# this to zero disables this function. The use of this member is
-# deprecated, use @reconnect-ms instead. (default: 0) (Since: 2.2)
-#
# @reconnect-ms: For a client socket, if a socket is disconnected,
# then attempt a reconnect after the given number of milliseconds.
-# Setting this to zero disables this function. This member is
-# mutually exclusive with @reconnect.
+# Setting this to zero disables this function.
# (default: 0) (Since: 9.2)
#
-# Features:
-#
-# @deprecated: Member @reconnect is deprecated. Use @reconnect-ms
-# instead.
-#
# Since: 1.4
##
{ 'struct': 'ChardevSocket',
'*telnet': 'bool',
'*tn3270': 'bool',
'*websocket': 'bool',
- '*reconnect': { 'type': 'int', 'features': [ 'deprecated' ] },
'*reconnect-ms': 'int' },
'base': 'ChardevCommon' }