修訂 | 739fcc1b0e4b04216f971c9fb87fb0e9ec599c34 (tree) |
---|---|
時間 | 2022-01-28 23:38:23 |
作者 | Peter Xu <peterx@redh...> |
Commiter | Juan Quintela |
migration: Drop return code for disgard ram process
It will just never fail. Drop those return values where they're constantly
zeros.
A tiny touch-up on the tracepoint so trace_ram_postcopy_send_discard_bitmap()
is called after the logic itself (which sounds more reasonable).
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
@@ -2991,10 +2991,7 @@ static int postcopy_start(MigrationState *ms) | ||
2991 | 2991 | * that are dirty |
2992 | 2992 | */ |
2993 | 2993 | if (migrate_postcopy_ram()) { |
2994 | - if (ram_postcopy_send_discard_bitmap(ms)) { | |
2995 | - error_report("postcopy send discard bitmap failed"); | |
2996 | - goto fail; | |
2997 | - } | |
2994 | + ram_postcopy_send_discard_bitmap(ms); | |
2998 | 2995 | } |
2999 | 2996 | |
3000 | 2997 | /* |
@@ -2459,8 +2459,6 @@ static void postcopy_chunk_hostpages_pass(MigrationState *ms, RAMBlock *block); | ||
2459 | 2459 | /** |
2460 | 2460 | * postcopy_each_ram_send_discard: discard all RAMBlocks |
2461 | 2461 | * |
2462 | - * Returns 0 for success or negative for error | |
2463 | - * | |
2464 | 2462 | * Utility for the outgoing postcopy code. |
2465 | 2463 | * Calls postcopy_send_discard_bm_ram for each RAMBlock |
2466 | 2464 | * passing it bitmap indexes and name. |
@@ -2469,10 +2467,9 @@ static void postcopy_chunk_hostpages_pass(MigrationState *ms, RAMBlock *block); | ||
2469 | 2467 | * |
2470 | 2468 | * @ms: current migration state |
2471 | 2469 | */ |
2472 | -static int postcopy_each_ram_send_discard(MigrationState *ms) | |
2470 | +static void postcopy_each_ram_send_discard(MigrationState *ms) | |
2473 | 2471 | { |
2474 | 2472 | struct RAMBlock *block; |
2475 | - int ret; | |
2476 | 2473 | |
2477 | 2474 | RAMBLOCK_FOREACH_NOT_IGNORED(block) { |
2478 | 2475 | postcopy_discard_send_init(ms, block->idstr); |
@@ -2490,14 +2487,9 @@ static int postcopy_each_ram_send_discard(MigrationState *ms) | ||
2490 | 2487 | * just needs indexes at this point, avoids it having |
2491 | 2488 | * target page specific code. |
2492 | 2489 | */ |
2493 | - ret = postcopy_send_discard_bm_ram(ms, block); | |
2490 | + postcopy_send_discard_bm_ram(ms, block); | |
2494 | 2491 | postcopy_discard_send_finish(ms); |
2495 | - if (ret) { | |
2496 | - return ret; | |
2497 | - } | |
2498 | 2492 | } |
2499 | - | |
2500 | - return 0; | |
2501 | 2493 | } |
2502 | 2494 | |
2503 | 2495 | /** |
@@ -2570,8 +2562,6 @@ static void postcopy_chunk_hostpages_pass(MigrationState *ms, RAMBlock *block) | ||
2570 | 2562 | /** |
2571 | 2563 | * ram_postcopy_send_discard_bitmap: transmit the discard bitmap |
2572 | 2564 | * |
2573 | - * Returns zero on success | |
2574 | - * | |
2575 | 2565 | * Transmit the set of pages to be discarded after precopy to the target |
2576 | 2566 | * these are pages that: |
2577 | 2567 | * a) Have been previously transmitted but are now dirty again |
@@ -2582,7 +2572,7 @@ static void postcopy_chunk_hostpages_pass(MigrationState *ms, RAMBlock *block) | ||
2582 | 2572 | * |
2583 | 2573 | * @ms: current migration state |
2584 | 2574 | */ |
2585 | -int ram_postcopy_send_discard_bitmap(MigrationState *ms) | |
2575 | +void ram_postcopy_send_discard_bitmap(MigrationState *ms) | |
2586 | 2576 | { |
2587 | 2577 | RAMState *rs = ram_state; |
2588 | 2578 |
@@ -2596,9 +2586,9 @@ int ram_postcopy_send_discard_bitmap(MigrationState *ms) | ||
2596 | 2586 | rs->last_sent_block = NULL; |
2597 | 2587 | rs->last_page = 0; |
2598 | 2588 | |
2599 | - trace_ram_postcopy_send_discard_bitmap(); | |
2589 | + postcopy_each_ram_send_discard(ms); | |
2600 | 2590 | |
2601 | - return postcopy_each_ram_send_discard(ms); | |
2591 | + trace_ram_postcopy_send_discard_bitmap(); | |
2602 | 2592 | } |
2603 | 2593 | |
2604 | 2594 | /** |
@@ -57,7 +57,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len); | ||
57 | 57 | void acct_update_position(QEMUFile *f, size_t size, bool zero); |
58 | 58 | void ram_postcopy_migrated_memory_release(MigrationState *ms); |
59 | 59 | /* For outgoing discard bitmap */ |
60 | -int ram_postcopy_send_discard_bitmap(MigrationState *ms); | |
60 | +void ram_postcopy_send_discard_bitmap(MigrationState *ms); | |
61 | 61 | /* For incoming postcopy discard */ |
62 | 62 | int ram_discard_range(const char *block_name, uint64_t start, size_t length); |
63 | 63 | int ram_postcopy_incoming_init(MigrationIncomingState *mis); |