[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-3.0 7/9] tests: introduce wait_for_migration
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH for-3.0 7/9] tests: introduce wait_for_migration_status() |
Date: |
Thu, 5 Jul 2018 11:27:25 +0100 |
User-agent: |
Mutt/1.10.0 (2018-05-17) |
* Peter Xu (address@hidden) wrote:
> It's generalized from wait_for_migration_complete() to allow us to wait
> for any migration status besides failure.
>
> Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
> ---
> tests/migration-test.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tests/migration-test.c b/tests/migration-test.c
> index 1d85ccbef1..761bf62ffe 100644
> --- a/tests/migration-test.c
> +++ b/tests/migration-test.c
> @@ -231,14 +231,15 @@ static void read_blocktime(QTestState *who)
> qobject_unref(rsp_return);
> }
>
> -static void wait_for_migration_complete(QTestState *who)
> +static void wait_for_migration_status(QTestState *who,
> + const char *goal)
> {
> while (true) {
> bool completed;
> char *status;
>
> status = migrate_query_status(who);
> - completed = strcmp(status, "completed") == 0;
> + completed = strcmp(status, goal) == 0;
> g_assert_cmpstr(status, !=, "failed");
> g_free(status);
> if (completed) {
> @@ -248,6 +249,11 @@ static void wait_for_migration_complete(QTestState *who)
> }
> }
>
> +static void wait_for_migration_complete(QTestState *who)
> +{
> + wait_for_migration_status(who, "completed");
> +}
> +
> static void wait_for_migration_pass(QTestState *who)
> {
> uint64_t initial_pass = get_migration_pass(who);
> --
> 2.17.1
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- [Qemu-devel] [PATCH for-3.0 5/9] tests: allow migrate() to take extra flags, (continued)
- [Qemu-devel] [PATCH for-3.0 5/9] tests: allow migrate() to take extra flags, Peter Xu, 2018/07/04
- [Qemu-devel] [PATCH for-3.0 6/9] tests: introduce migrate_query*() helpers, Peter Xu, 2018/07/04
- [Qemu-devel] [PATCH for-3.0 7/9] tests: introduce wait_for_migration_status(), Peter Xu, 2018/07/04
- [Qemu-devel] [PATCH for-3.0 8/9] tests: add postcopy recovery test, Peter Xu, 2018/07/04
- [Qemu-devel] [PATCH for-3.0 9/9] tests: hide stderr for postcopy recovery test, Peter Xu, 2018/07/04
- Re: [Qemu-devel] [PATCH for-3.0 0/9] migration: postcopy recovery unit test, bug fixes, Dr. David Alan Gilbert, 2018/07/06