Skip to content

Refactor and cleanup migration code

Juan Quintela qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest posting 2/223 patches 20 repliesIn review
  2. v3 posting 1/223 patches 0 repliesSuperseded
  3. v228 patches 12 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v122 patches27 repliesSuperseded

Changes in v3 from the cover letter

this patch applies on top of my previous "migration error" patches. All error handling has been moved to that series, except for "propagate error correctly", without this refactoring, it is quite complicated to apply it.

Patches in v3 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23migration: Make *start_outgoing_migration return FdMigrationStatemigration-exec.c migration-fd.c migration-tcp.c +3 more+14 -140 replies
2/23migration: Use FdMigrationState instead of MigrationState when possiblemigration.c migration.h+24 -260 replies
3/23migration: Fold MigrationState into FdMigrationStatemigration-exec.c migration-fd.c migration-tcp.c +3 more+31 -460 replies
4/23migration: Rename FdMigrationState MigrationStatemigration-exec.c migration-fd.c migration-tcp.c +3 more+58 -580 replies
5/23migration: Refactor MigrationState creationmigration-exec.c migration-fd.c migration-tcp.c +3 more+32 -703 replies
6/23migration: Make all posible migration functions staticmigration.c migration.h+36 -480 replies
7/23migration: move migrate_create_state to do_migratemigration-exec.c migration-fd.c migration-tcp.c +3 more+48 -990 replies
8/23migration: Introduce MIG_STATE_NONEmigration.c migration.h+12 -50 replies
9/23migration: Refactor and simplify error checking in migrate_fd_put_readymigration.c+10 -110 replies
10/23migration: Introduce migrate_fd_completed() for consistencymigration.c+13 -70 replies
11/23migration: Our release callback was just freemigration.c migration.h+1 -190 replies
12/23migration: Remove get_status() accessormigration.c migration.h+5 -120 replies
13/23migration: Remove migration cancel() callbackmigration.c migration.h+4 -60 replies
14/23migration: Move exported functions to the end of the filemigration.c+91 -971 reply
15/23migration: use global variable directlymigration.c+2 -42 replies
16/23migration: another case of global variable assigned to local onemigration.c+1 -20 replies
17/23migration: make sure we always have a migration statemigration.c+54 -725 replies
18/23migration: Use bandwidth_limit directlymigration.c+10 -91 reply
19/23migration: Export a function that tells if the migration has finished correctlymigration.c migration.h ui/spice-core.c+4 -63 replies
20/23migration: Make state definitions localmigration.c migration.h+8 -80 replies
21/23migration: Don't use callback on file defining itmigration-tcp.c migration-unix.c+5 -52 replies
22/23migration: propagate error correctlymigration-tcp.c migration-unix.c+21 -251 reply
23/23migration: make migration-{tcp, unix} consistentmigration-tcp.c migration-unix.c+35 -261 reply

Reviews trailers per patch

3 of 23 patches have a Reviewed-by or Acked-by.

PatchAnthony Liguori
1/23
2/23
3/23
4/23
5/23
6/23
7/23
8/23
9/23
10/23
11/23
12/23
13/23
14/23R-b
15/23
16/23
17/23
18/23
19/23
20/23
21/23
22/23R-b
23/23R-b

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

Read the v3 thread

Cover letter [Qemu-devel] [PATCH v3 00/23] Refactor and cleanup migration code

Hi

v4:

rebase on top of new qemu and new migration-errors series

v3:
this patch applies on top of my previous "migration error" patches. All error handling has been moved to that series, except for "propagate error correctly", without this refactoring, it is quite complicated to apply it.

Please, review.

Later, Juan.

v3:
- more checkpatch.pl happines
- split error handling in a previous series
- make Anthony happy. current_migration is still a pointer, but points to a static variable. We can change current_migration when we integrate kemari.

v2:
- make Jan^Wcheckpatch.pl happy
- Yoshiaki Tamura suggestions:
- include its two patches to clean things
- MAX_THROTTLE define
- migration_state enum
- I removed spurious differences between migration-{tcp,unix}
- better error propagation, after this patch:
migrate -d "tcp:name_don_exist:port"
migrate -d "tcp:name:port_dont_exist"
migrate -d "exec: prog_dont_exist"
migrate -d "exec: gzip > /path/dont/exist"
fail as expected. Last two used to enter an infinite loop.

The fixes part should be backported to 0.14, waiting for the review to do that.

Later, Juan.

v1:
This series:
- Fold MigrationState into FdMigrationState (and then rename)
- Factorize migration statec creation in a single place
- Make use of MIG_STATE_*, setup through helpers and make them local
- remove relase & cancel callbacks (where used only one in same file than defined)
- get_status() is no more, just access directly to .state
- current_migration use cleanup, and make variable static
- max_throotle is gone, now inside current_migration
- change get_migration_status() to migration_has_finished() and actualize single user.

Please review.

Later, Juan.

Juan Quintela (23):
migration: Make *start_outgoing_migration return FdMigrationState
migration: Use FdMigrationState instead of MigrationState when
possible
migration: Fold MigrationState into FdMigrationState
migration: Rename FdMigrationState MigrationState
migration: Refactor MigrationState creation
migration: Make all posible migration functions static
migration: move migrate_create_state to do_migrate
migration: Introduce MIG_STATE_NONE
migration: Refactor and simplify error checking in
migrate_fd_put_ready
migration: Introduce migrate_fd_completed() for consistency
migration: Our release callback was just free
migration: Remove get_status() accessor
migration: Remove migration cancel() callback
migration: Move exported functions to the end of the file
migration: use global variable directly
migration: another case of global variable assigned to local one
migration: make sure we always have a migration state
migration: Use bandwidth_limit directly
migration: Export a function that tells if the migration has finished
correctly
migration: Make state definitions local
migration: Don't use callback on file defining it
migration: propagate error correctly
migration: make migration-{tcp,unix} consistent

 migration-exec.c |   39 +----
 migration-fd.c   |   42 ++-----
 migration-tcp.c  |   76 ++++------
 migration-unix.c |  112 ++++++---------
 migration.c      |  404 ++++++++++++++++++++++++++---------------------------
 migration.h      |   85 ++----------
 ui/spice-core.c  |    4 +-
 7 files changed, 303 insertions(+), 459 deletions(-)
Signature · 1 line
1.7.6.2