[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v13 3/3] tests: Add basic migration precopy tcp
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH v13 3/3] tests: Add basic migration precopy tcp test |
Date: |
Wed, 20 Feb 2019 11:20:34 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 |
On 20/02/2019 10.22, Juan Quintela wrote:
> Not sharing code from precopy/unix because we have to read back the
> tcp parameter.
>
> Reviewed-by: Dr. David Alan Gilbert <address@hidden>
> Reviewed-by: Peter Xu <address@hidden>
> Signed-off-by: Juan Quintela <address@hidden>
> ---
> tests/migration-test.c | 109 +++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 104 insertions(+), 5 deletions(-)
>
> diff --git a/tests/migration-test.c b/tests/migration-test.c
> index b0670efde7..a27f095b28 100644
> --- a/tests/migration-test.c
> +++ b/tests/migration-test.c
> @@ -20,6 +20,9 @@
> #include "qemu/sockets.h"
> #include "chardev/char.h"
> #include "sysemu/sysemu.h"
> +#include "qapi/qapi-visit-sockets.h"
> +#include "qapi/qobject-input-visitor.h"
> +#include "qapi/qobject-output-visitor.h"
>
> #include "migration/migration-test.h"
>
> @@ -332,15 +335,67 @@ static void cleanup(const char *filename)
> g_free(path);
> }
>
> +static char *SocketAddress_to_str(SocketAddress *addr)
> +{
> + switch (addr->type) {
> + case SOCKET_ADDRESS_TYPE_INET:
> + return g_strdup_printf("tcp:%s:%s",
> + addr->u.inet.host,
> + addr->u.inet.port);
> + break;
> + case SOCKET_ADDRESS_TYPE_UNIX:
> + return g_strdup_printf("unix:%s",
> + addr->u.q_unix.path);
> + break;
> + case SOCKET_ADDRESS_TYPE_FD:
> + return g_strdup_printf("fd:%s", addr->u.fd.str);
> + break;
> + default:
> + abort();
> + }
> +}
You could also remove the "break" statements after the return statements
in this function. Apart from that:
Acked-by: Thomas Huth <address@hidden>