Revision | 53405ffb33e31c32725d7c463f07074d4f622677 (tree) |
---|---|
Time | 2022-01-28 23:38:23 |
Author | Peter Xu <peterx@redh...> |
Commiter | Juan Quintela |
migration: Drop dead code of ram_debug_dump_bitmap()
I planned to add "#ifdef DEBUG_POSTCOPY" around the function too because
otherwise it'll be compiled into qemu binary even if it'll never be used. Then
I found that maybe it's easier to just drop it for good..
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>
@@ -2394,40 +2394,6 @@ static void ram_state_reset(RAMState *rs) | ||
2394 | 2394 | |
2395 | 2395 | #define MAX_WAIT 50 /* ms, half buffered_file limit */ |
2396 | 2396 | |
2397 | -/* | |
2398 | - * 'expected' is the value you expect the bitmap mostly to be full | |
2399 | - * of; it won't bother printing lines that are all this value. | |
2400 | - * If 'todump' is null the migration bitmap is dumped. | |
2401 | - */ | |
2402 | -void ram_debug_dump_bitmap(unsigned long *todump, bool expected, | |
2403 | - unsigned long pages) | |
2404 | -{ | |
2405 | - int64_t cur; | |
2406 | - int64_t linelen = 128; | |
2407 | - char linebuf[129]; | |
2408 | - | |
2409 | - for (cur = 0; cur < pages; cur += linelen) { | |
2410 | - int64_t curb; | |
2411 | - bool found = false; | |
2412 | - /* | |
2413 | - * Last line; catch the case where the line length | |
2414 | - * is longer than remaining ram | |
2415 | - */ | |
2416 | - if (cur + linelen > pages) { | |
2417 | - linelen = pages - cur; | |
2418 | - } | |
2419 | - for (curb = 0; curb < linelen; curb++) { | |
2420 | - bool thisbit = test_bit(cur + curb, todump); | |
2421 | - linebuf[curb] = thisbit ? '1' : '.'; | |
2422 | - found = found || (thisbit != expected); | |
2423 | - } | |
2424 | - if (found) { | |
2425 | - linebuf[curb] = '\0'; | |
2426 | - fprintf(stderr, "0x%08" PRIx64 " : %s\n", cur, linebuf); | |
2427 | - } | |
2428 | - } | |
2429 | -} | |
2430 | - | |
2431 | 2397 | /* **** functions for postcopy ***** */ |
2432 | 2398 | |
2433 | 2399 | void ram_postcopy_migrated_memory_release(MigrationState *ms) |
@@ -2655,11 +2621,6 @@ int ram_postcopy_send_discard_bitmap(MigrationState *ms) | ||
2655 | 2621 | if (ret) { |
2656 | 2622 | return ret; |
2657 | 2623 | } |
2658 | - | |
2659 | -#ifdef DEBUG_POSTCOPY | |
2660 | - ram_debug_dump_bitmap(block->bmap, true, | |
2661 | - block->used_length >> TARGET_PAGE_BITS); | |
2662 | -#endif | |
2663 | 2624 | } |
2664 | 2625 | trace_ram_postcopy_send_discard_bitmap(); |
2665 | 2626 |
@@ -55,8 +55,6 @@ void mig_throttle_counter_reset(void); | ||
55 | 55 | uint64_t ram_pagesize_summary(void); |
56 | 56 | 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 | -void ram_debug_dump_bitmap(unsigned long *todump, bool expected, | |
59 | - unsigned long pages); | |
60 | 58 | void ram_postcopy_migrated_memory_release(MigrationState *ms); |
61 | 59 | /* For outgoing discard bitmap */ |
62 | 60 | int ram_postcopy_send_discard_bitmap(MigrationState *ms); |