From 0983f5e6af76d5df8c6346cbdfff9d8305fb6da0 Mon Sep 17 00:00:00 2001 From: Daniel P. Berrange Date: Tue, 1 Sep 2015 14:46:50 +0100 Subject: sockets: allow port to be NULL when listening on IP address If the port in the SocketAddress struct is NULL, it can allow the kernel to automatically select a free port. This is useful in particular in unit tests to avoid a race trying to find a free port to run a test case on. Signed-off-by: Daniel P. Berrange --- qapi-schema.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qapi-schema.json') diff --git a/qapi-schema.json b/qapi-schema.json index 702b7b5dbd..f60be2950c 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2614,7 +2614,9 @@ # # @host: host part of the address # -# @port: port part of the address, or lowest port if @to is present +# @port: port part of the address, or lowest port if @to is present. +# Kernel selects a free port if omitted for listener addresses. +# #optional # # @to: highest port to try # @@ -2629,7 +2631,7 @@ { 'struct': 'InetSocketAddress', 'data': { 'host': 'str', - 'port': 'str', + '*port': 'str', '*to': 'uint16', '*ipv4': 'bool', '*ipv6': 'bool' } } -- cgit v1.2.3-55-g7522