qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.5 v4 2/4] vhost-user-test: use unix port for migration
Date: Tue, 01 Dec 2015 13:11:38 +0000	[thread overview]
Message-ID: <874mg2b9f9.fsf@linaro.org> (raw)
In-Reply-To: <1448901890-17012-3-git-send-email-marcandre.lureau@redhat.com>


marcandre.lureau@redhat.com writes:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> TCP port 1234 may be used by another process concurrently. Instead use a
> temporary unix socket.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  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));
>
>  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;
>
>      server->socket_path = g_strdup_printf("%s/%s.sock", tmpfs, name);
> +    server->mig_path = g_strdup_printf("%s/%s.mig", tmpfs, name);
>
>      chr_path = g_strdup_printf("unix:%s,server,nowait", server->socket_path);
>      server->chr_name = 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);
>
> +    unlink(server->mig_path);
> +    g_free(server->mig_path);
> +
>      g_free(server->chr_name);
>      g_free(server);
>
> @@ -512,7 +517,7 @@ static void test_migrate(void)
>  {
>      TestServer *s = test_server_new("src");
>      TestServer *dest = test_server_new("dest");
> -    const char *uri = "tcp:127.0.0.1:1234";
> +    char *uri = g_strdup_printf("%s%s", "unix:", dest->mig_path);
>      QTestState *global = 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);
>
>      global_qtest = global;
>  }


--
Alex Bennée

  reply	other threads:[~2015-12-01 13:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 16:44 [Qemu-devel] [PATCH for-2.5 v4 0/4] vhost-user-test fixes marcandre.lureau
2015-11-30 16:44 ` [Qemu-devel] [PATCH for-2.5 v4 1/4] vhost-user-test: fix chardriver race marcandre.lureau
2015-12-01 13:10   ` Alex Bennée
2015-11-30 16:44 ` [Qemu-devel] [PATCH for-2.5 v4 2/4] vhost-user-test: use unix port for migration marcandre.lureau
2015-12-01 13:11   ` Alex Bennée [this message]
2015-11-30 16:44 ` [Qemu-devel] [PATCH for-2.5 v4 3/4] vhost-user-test: fix crash with glib < 2.36 marcandre.lureau
2015-12-01 13:15   ` Alex Bennée
2015-11-30 16:44 ` [Qemu-devel] [PATCH for-2.5 v4 4/4] tests: add vhost-user-test when target is x64 only marcandre.lureau
2015-12-01 13:10   ` Alex Bennée
2015-12-01 13:28     ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874mg2b9f9.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).