Skip to content

Migration test refactoring

Juan Quintela qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest42 patches 33 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/42migration-test: Be consistent for ppctests/qtest/migration-test.c+1 -13 replies
2/42migration-test: Make ignore_stderr regular with other optionstests/qtest/migration-test.c+4 -62 replies
3/42migration-test: simplify shmem_opts handlingtests/qtest/migration-test.c+4 -53 replies
4/42migration-test: Make machine_opts regular with other optionstests/qtest/migration-test.c+4 -61 reply
5/42migration-test: Create arch_optstests/qtest/migration-test.c+13 -151 reply
6/42migration-test: machine_opts is really arch specifictests/qtest/migration-test.c+5 -91 reply
7/42migration-test: Create kvm_optstests/qtest/migration-test.c+7 -41 reply
8/42migration-test: bootpath is the same for all tests and for all archstests/qtest/migration-test.c+9 -111 reply
9/42migration-test: Add bootfile_create/delete() functionstests/qtest/migration-test.c+36 -141 reply
10/42migration-test: dirtylimit checks for x86_64 arch beforetests/qtest/migration-test.c+1 -41 reply
11/42migration-test: Update test_ignore_shared to use argstests/qtest/migration-test.c+4 -12 replies
12/42migration-test: Enable back ignore-shared testtests/qtest/migration-test.c+1 -45 replies
13/42migration-test: Check for shared memory like for everything elsetests/qtest/migration-test.c+12 -84 replies
14/42migration-test: test_migrate_start() always return 0tests/qtest/migration-test.c+10 -281 reply
15/42migration-test: migrate_postcopy_prepare() always return 0tests/qtest/migration-test.c+5 -111 reply
16/42migration-test: Create do_migrate()tests/qtest/migration-test.c+21 -202 replies
17/42migration-test: Introduce GuestStatetests/qtest/migration-test.c+180 -1500 replies
18/42migration-test: Create guest before calling do_test_validate_uuid()tests/qtest/migration-test.c+14 -70 replies
19/42migration-test: Create guest before calling test_precopy_common()tests/qtest/migration-test.c+89 -330 replies
20/42migration-test: Create guest before calling test_postcopy_common()tests/qtest/migration-test.c+17 -90 replies
21/42migration-test: Move common guest code to guest_create()tests/qtest/migration-test.c+55 -490 replies
22/42migration-test: Create guest_use_dirty_log()tests/qtest/migration-test.c+15 -120 replies
23/42migration-test: Move serial to GuestStatetests/qtest/migration-test.c+37 -280 replies
24/42migration-test: Re-enable multifd_cancel testtests/qtest/migration-test.c+2 -83 replies
25/42migration-test: We were not waiting for "target" to finishtests/qtest/migration-test.c+2 -00 replies
26/42migration-test: create guest_use_shmem()tests/qtest/migration-test.c+22 -240 replies
27/42migration-test: Create guest_extra_opts()tests/qtest/migration-test.c+16 -120 replies
28/42migration-test: Create guest_hide_stderr()tests/qtest/migration-test.c+54 -610 replies
29/42migration-test: Create the migration unix socket by guesttests/qtest/migration-test.c+32 -180 replies
30/42migration-test: Hooks also need GuestStatetests/qtest/migration-test.c+86 -1120 replies
31/42migration-test: Preffer to->uri to uri parameter for migrationtests/qtest/migration-test.c+15 -50 replies
32/42migration-test: Create guest_set_uri()tests/qtest/migration-test.c+10 -10 replies
33/42migration-test: Remove connect_uritests/qtest/migration-test.c+13 -390 replies
34/42migration-test: Use new schema for all tests that use unix socketstests/qtest/migration-test.c+11 -280 replies
35/42migration-test: Set uri for tcp tests with guest_set_uri()tests/qtest/migration-test.c+13 -130 replies
36/42migration-test: Remove unused listen_uritests/qtest/migration-test.c+10 -240 replies
37/42migration-test: Create get_event GuestState variabletests/qtest/migration-test.c+22 -260 replies
38/42migration-test: Create guest_realize()tests/qtest/migration-test.c+54 -930 replies
39/42migration-test: Unfold test_migrate_end() into three functionstests/qtest/migration-test.c+35 -280 replies
40/42migration-test: Create migrate_incoming() functiontests/qtest/migration-test.c+11 -120 replies
41/42migration-test: Move functions to migration-helpers.ctests/qtest/migration-helpers.c tests/qtest/migration-helpers.h tests/qtest/migration-test.c+281 -2600 replies
42/42migration-test: Split vcpu-dirty-limit-testMAINTAINERS tests/qtest/meson.build tests/qtest/migration-test.c +1 more+316 -2480 replies

Reviews trailers per patch

13 of 42 patches have a Reviewed-by or Acked-by.

PatchPeter XuLaurent Vivier
1/42R-b
2/42
3/42R-b
4/42R-b
5/42R-b
6/42R-b
7/42R-b
8/42R-b
9/42R-b
10/42R-b
11/42R-b
12/42
13/42R-b
14/42R-b
15/42R-b
16/42
17/42
18/42
19/42
20/42
21/42
22/42
23/42
24/42
25/42
26/42
27/42
28/42
29/42
30/42
31/42
32/42
33/42
34/42
35/42
36/42
37/42
38/42
39/42
40/42
41/42
42/42

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/42] Migration test refactoring

Hi

This series do a lot of much neededs cleanups and fixes to migration-test:

- We make source and target machines coherent/constent
- We make all command line options consistent
- We split test_migrate_start() and test_migrate_end() into:

* guest_start() from from and to. It is the same function, just defines the basic options. I am open to renaming it to guest_define() or anything else that people can came with.

* guest_destroy(), you have guessed it, right?

* guest_realize() after guest_start() and adding any options we need, we just create the guest. We use the same function from source and target, making inconsistencies disapear.

- uri: right now it is a mess, we can have:
* uri created with migration_start()
* or listen_uri
* or connect_uri
* or by hand
now we just setup to->uri, and we get the migrate uri automatically from there.

- we were creating bootfile for each migration test. Change the code so we only create it once for the whole migration test.

- Introduce GuestState. Using QTestState directly means that we can add state by guest, making it abuse local variables. Now we move all guest state into GuestState.

- Apart from test found by Fabiano, we had another problems with multifd + cancel:

* We didn't wait for "to" guest to finish before we launch second target guest "to2". We fixed it by destroying "to" before launching "to2".

* We reused "dest_serial" filename from "to" and "to2", so in a very loaded host, it could be that we contact with the wrong vm, and we never end.

* I change the code so the serial filename is dependent on guest name, that made changing the interface:
wait_for_serial("dest_serial") to wait_for_relial(to) (or to2 or ...) so we can't fail.

- we move the global event variables to GuestState, so no more got_src_stop or got_dst_resume, we just check

    who->got_event

- create a function from migrate-incoming, so now we do:
migrate_incoming(uri) and it does what we want/expect.

- vcpu_dirty_limit is not related to migration at all, just is easier to write with migration infrastructure. Move all useful functions to migration-helpers.[ch] and split the test into vcpu-dirty-limit-test.c. I think that we can declare that test slow.

- Now that guest_create/destry exist, we can "reuse" them in vcpu_dirty_limit test.

- The removal of files, like "migsocket" was flaky at least, i.e. not always removed. "migsocket-recover" was not even tried to remove. New code just remove them by default.

- MigrationStart is gone, instead of creating that flags, I just call functions that do that function.

- if no uri is given for a target guest, it launches with -incoming defer, that should be the default.

ToDo:

- Tests shouldn't really use QMP, if we need QMP, we should hide it behind a c function. Almost everything is there now, except things like "reuse".

- I think we should split auto-converge test:
* we are not testing migration there, we are testing vcpu slowdown
* the test is really slow, see documentation why we can't make it much faster.

- I still need to make test faster with stoping switchover.

Please, review.

Juan Quintela (42):
migration-test: Be consistent for ppc
migration-test: Make ignore_stderr regular with other options
migration-test: simplify shmem_opts handling
migration-test: Make machine_opts regular with other options
migration-test: Create arch_opts
migration-test: machine_opts is really arch specific
migration-test: Create kvm_opts
migration-test: bootpath is the same for all tests and for all archs
migration-test: Add bootfile_create/delete() functions
migration-test: dirtylimit checks for x86_64 arch before
migration-test: Update test_ignore_shared to use args
migration-test: Enable back ignore-shared test
migration-test: Check for shared memory like for everything else
migration-test: test_migrate_start() always return 0
migration-test: migrate_postcopy_prepare() always return 0
migration-test: Create do_migrate()
migration-test: Introduce GuestState
migration-test: Create guest before calling do_test_validate_uuid()
migration-test: Create guest before calling test_precopy_common()
migration-test: Create guest before calling test_postcopy_common()
migration-test: Move common guest code to guest_create()
migration-test: Create guest_use_dirty_log()
migration-test: Move serial to GuestState
migration-test: Re-enable multifd_cancel test
migration-test: We were not waiting for "target" to finish
migration-test: create guest_use_shmem()
migration-test: Create guest_extra_opts()
migration-test: Create guest_hide_stderr()
migration-test: Create the migration unix socket by guest
migration-test: Hooks also need GuestState
migration-test: Preffer to->uri to uri parameter for migration
migration-test: Create guest_set_uri()
migration-test: Remove connect_uri
migration-test: Use new schema for all tests that use unix sockets
migration-test: Set uri for tcp tests with guest_set_uri()
migration-test: Remove unused listen_uri
migration-test: Create get_event GuestState variable
migration-test: Create guest_realize()
migration-test: Unfold test_migrate_end() into three functions
migration-test: Create migrate_incoming() function
migration-test: Move functions to migration-helpers.c
migration-test: Split vcpu-dirty-limit-test

 MAINTAINERS                         |    3 +-
 tests/qtest/migration-helpers.h     |   39 +
 tests/qtest/migration-helpers.c     |  242 +++++
 tests/qtest/migration-test.c        | 1525 +++++++++------------------
 tests/qtest/vcpu-dirty-limit-test.c |  310 ++++++
 tests/qtest/meson.build             |    5 +-
 6 files changed, 1113 insertions(+), 1011 deletions(-)
 create mode 100644 tests/qtest/vcpu-dirty-limit-test.c

base-commit: 45ae97993a75f975f1a01d25564724c7e10a543f
prerequisite-patch-id: f95418b6f47019ec82d47aac8ba5247775f503a3

Signature · 1 line
2.40.1