chardev: split tcp_chr_wait_connected into two methods
commitefae0b9202f1acf04b958abb9c6b8431a60521ff
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 11 Feb 2019 18:24:35 +0000 (11 18:24 +0000)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 12 Feb 2019 16:35:56 +0000 (12 17:35 +0100)
tree2bb7a5c5fdc579de782946dd3b1a154b30b8675c
parente154fd7991872980a07069b45b5bea8af9acb282
chardev: split tcp_chr_wait_connected into two methods

The tcp_chr_wait_connected method can deal with either server or client
chardevs, but some callers only care about one of these possibilities.
The tcp_chr_wait_connected method will also need some refactoring to
reliably deal with its primary goal of allowing a device frontend to
wait for an established connection, which will interfere with other
callers.

Split it into two methods, one responsible for server initiated
connections, the other responsible for client initiated connections.
In doing this split the tcp_char_connect_async() method is renamed
to become consistent with naming of the new methods.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190211182442.8542-10-berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
chardev/char-socket.c