From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4E7e-0002TD-70 for qemu-devel@nongnu.org; Wed, 02 Dec 2015 15:35:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4E7d-0002Vu-8D for qemu-devel@nongnu.org; Wed, 02 Dec 2015 15:35:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47693) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4E7c-0002Vq-SK for qemu-devel@nongnu.org; Wed, 02 Dec 2015 15:35:28 -0500 Date: Wed, 2 Dec 2015 22:35:25 +0200 From: "Michael S. Tsirkin" Message-ID: <1449088478-21099-3-git-send-email-mst@redhat.com> References: <1449088478-21099-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1449088478-21099-1-git-send-email-mst@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 2/9] vhost-user-test: use unix port for migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Peter Maydell , Yuanhan Liu , Paolo Bonzini , =?us-ascii?B?PT9VVEYtOD9xP01hcmMtQW5kcj1DMz1BOT0yMEx1cmVhdT89?= From: Marc-Andr=E9 Lureau TCP port 1234 may be used by another process concurrently. Instead use a temporary unix socket. Signed-off-by: Marc-Andr=E9 Lureau Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/vhost-user-test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 261f4b7..29205ed 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -123,6 +123,7 @@ static VhostUserMsg m __attribute__ ((unused)); =20 typedef struct TestServer { gchar *socket_path; + gchar *mig_path; gchar *chr_name; CharDriverState *chr; int fds_num; @@ -364,6 +365,7 @@ static TestServer *test_server_new(const gchar *name) gchar *chr_path; =20 server->socket_path =3D g_strdup_printf("%s/%s.sock", tmpfs, name); + server->mig_path =3D g_strdup_printf("%s/%s.mig", tmpfs, name); =20 chr_path =3D g_strdup_printf("unix:%s,server,nowait", server->socket= _path); server->chr_name =3D g_strdup_printf("chr-%s", name); @@ -405,6 +407,9 @@ static gboolean _test_server_free(TestServer *server) unlink(server->socket_path); g_free(server->socket_path); =20 + unlink(server->mig_path); + g_free(server->mig_path); + g_free(server->chr_name); g_free(server); =20 @@ -512,7 +517,7 @@ static void test_migrate(void) { TestServer *s =3D test_server_new("src"); TestServer *dest =3D test_server_new("dest"); - const char *uri =3D "tcp:127.0.0.1:1234"; + char *uri =3D g_strdup_printf("%s%s", "unix:", dest->mig_path); QTestState *global =3D global_qtest, *from, *to; GSource *source; gchar *cmd; @@ -583,6 +588,7 @@ static void test_migrate(void) test_server_free(dest); qtest_quit(from); test_server_free(s); + g_free(uri); =20 global_qtest =3D global; } --=20 MST