Lines Matching full:bitmap

2  * Block dirty bitmap postcopy migration
24 * Bitmap migration implies creating bitmap with the same name and granularity
25 * in destination QEMU. If the bitmap with the same name (for the same node)
34 * [ 1 byte: bitmap alias size ] \ flags & BITMAP_NAME
35 * [ n bytes: bitmap alias ] /
37 * # Start of bitmap migration (flags & START)
40 * 1 byte: bitmap flags (corresponds to BdrvDirtyBitmap)
41 * bit 0 - bitmap is enabled
42 * bit 1 - bitmap is persistent
43 * bit 2 - bitmap is autoloading
46 * # Complete of bitmap migration (flags & COMPLETE)
49 * # Data chunk of bitmap migration
57 * device and/or bitmap names, assuming them to be the same with the previous
64 #include "block/dirty-bitmap.h"
109 /* State of one bitmap during save process */
115 BdrvDirtyBitmap *bitmap; member
126 /* State of the dirty bitmap migration (DBM) during save process */
140 BdrvDirtyBitmap *bitmap; member
145 /* State of the dirty bitmap migration (DBM) during load process */
152 BdrvDirtyBitmap *bitmap; member
177 /* For hash tables that map node/bitmap names to aliases */
204 * and bitmap names to their respective aliases (for outgoing
208 * and bitmap aliases to their respective names (for incoming
213 * .subtree table maps bitmap names/aliases to the respective bitmap
290 "The bitmap alias '%s' is longer than %u bytes", in construct_alias_map()
296 error_setg(errp, "The bitmap name '%s' is longer than %d bytes", in construct_alias_map()
305 error_setg(errp, "The bitmap '%s'/'%s' is mapped twice", in construct_alias_map()
313 error_setg(errp, "The bitmap alias '%s'/'%s' is used twice", in construct_alias_map()
335 * the user-specified block-bitmap-mapping migration parameter.)
384 BdrvDirtyBitmap *bitmap = dbms->bitmap; in send_bitmap_header() local
393 if (bitmap != s->prev_bitmap) { in send_bitmap_header()
394 s->prev_bitmap = bitmap; in send_bitmap_header()
413 qemu_put_be32(f, bdrv_dirty_bitmap_granularity(dbms->bitmap)); in send_bitmap_start()
431 dbms->bitmap, start_sector << BDRV_SECTOR_BITS, in send_bitmap_bits()
438 dbms->bitmap, buf, start_sector << BDRV_SECTOR_BITS, in send_bitmap_bits()
474 bdrv_dirty_bitmap_set_busy(dbms->bitmap, false); in dirty_bitmap_do_save_cleanup()
487 BdrvDirtyBitmap *bitmap; in add_bitmaps_to_list() local
495 FOR_EACH_DIRTY_BITMAP(bs, bitmap) { in add_bitmaps_to_list()
496 if (bdrv_dirty_bitmap_name(bitmap)) { in add_bitmaps_to_list()
500 if (!bitmap) { in add_bitmaps_to_list()
504 bitmap_name = bdrv_dirty_bitmap_name(bitmap); in add_bitmaps_to_list()
507 error_setg(errp, "Bitmap '%s' in unnamed node can't be migrated", in add_bitmaps_to_list()
528 error_setg(errp, "Bitmap '%s' in a node with auto-generated " in add_bitmaps_to_list()
534 FOR_EACH_DIRTY_BITMAP(bs, bitmap) { in add_bitmaps_to_list()
536 bitmap_name = bdrv_dirty_bitmap_name(bitmap); in add_bitmaps_to_list()
541 if (bdrv_dirty_bitmap_check(bitmap, BDRV_BITMAP_DEFAULT, errp)) { in add_bitmaps_to_list()
560 error_setg(errp, "Cannot migrate bitmap '%s' on node '%s': " in add_bitmaps_to_list()
569 bdrv_dirty_bitmap_set_busy(bitmap, true); in add_bitmaps_to_list()
575 dbms->bitmap = bitmap; in add_bitmaps_to_list()
578 (bdrv_dirty_bitmap_granularity(bitmap) >> BDRV_SECTOR_BITS); in add_bitmaps_to_list()
580 if (bdrv_dirty_bitmap_enabled(bitmap)) { in add_bitmaps_to_list()
589 if (bdrv_dirty_bitmap_get_persistence(bitmap)) { in add_bitmaps_to_list()
666 bdrv_dirty_bitmap_skip_store(dbms->bitmap, true); in init_dirty_bitmap_migration()
780 uint64_t gran = bdrv_dirty_bitmap_granularity(dbms->bitmap); in dirty_bitmap_state_pending()
794 /* First occurrence of this bitmap. It should be created if doesn't exist */
807 if (s->bitmap) { in dirty_bitmap_load_start()
808 error_report("Bitmap with the same name ('%s') already exists on " in dirty_bitmap_load_start()
809 "destination", bdrv_dirty_bitmap_name(s->bitmap)); in dirty_bitmap_load_start()
812 s->bitmap = bdrv_create_dirty_bitmap(s->bs, granularity, in dirty_bitmap_load_start()
814 if (!s->bitmap) { in dirty_bitmap_load_start()
821 error_report("Unknown flags in migrated dirty bitmap header: %x", in dirty_bitmap_load_start()
835 bdrv_dirty_bitmap_set_persistence(s->bitmap, true); in dirty_bitmap_load_start()
838 bdrv_disable_dirty_bitmap(s->bitmap); in dirty_bitmap_load_start()
840 bdrv_dirty_bitmap_create_successor(s->bitmap, &local_err); in dirty_bitmap_load_start()
846 bdrv_dirty_bitmap_set_busy(s->bitmap, true); in dirty_bitmap_load_start()
851 b->bitmap = s->bitmap; in dirty_bitmap_load_start()
875 bdrv_enable_dirty_bitmap(b->bitmap); in before_vm_start_handle_item()
877 bdrv_dirty_bitmap_enable_successor(b->bitmap); in before_vm_start_handle_item()
909 s->bitmap = NULL; in cancel_incoming_locked()
916 * Bitmap must be unfinished, as finished bitmaps should already be in cancel_incoming_locked()
920 if (bdrv_dirty_bitmap_has_successor(b->bitmap)) { in cancel_incoming_locked()
921 bdrv_reclaim_dirty_bitmap(b->bitmap, &error_abort); in cancel_incoming_locked()
923 bdrv_dirty_bitmap_set_busy(b->bitmap, false); in cancel_incoming_locked()
925 bdrv_release_dirty_bitmap(b->bitmap); in cancel_incoming_locked()
957 bdrv_dirty_bitmap_deserialize_finish(s->bitmap); in dirty_bitmap_load_complete()
959 if (bdrv_dirty_bitmap_has_successor(s->bitmap)) { in dirty_bitmap_load_complete()
960 bdrv_reclaim_dirty_bitmap(s->bitmap, &error_abort); in dirty_bitmap_load_complete()
962 bdrv_dirty_bitmap_set_busy(s->bitmap, false); in dirty_bitmap_load_complete()
968 if (b->bitmap == s->bitmap) { in dirty_bitmap_load_complete()
989 bdrv_dirty_bitmap_deserialize_zeroes(s->bitmap, first_byte, in dirty_bitmap_load_bits()
1000 * cancelled mode as we don't have the bitmap to check the constraints in dirty_bitmap_load_bits()
1004 * a bit larger (which means that bitmap migration will fail anyway and in dirty_bitmap_load_bits()
1009 error_report("Bitmap migration stream buffer allocation request " in dirty_bitmap_load_bits()
1017 error_report("Failed to read bitmap bits"); in dirty_bitmap_load_bits()
1025 needed_size = bdrv_dirty_bitmap_serialization_size(s->bitmap, in dirty_bitmap_load_bits()
1033 error_report("Migrated bitmap granularity doesn't " in dirty_bitmap_load_bits()
1034 "match the destination bitmap '%s' granularity", in dirty_bitmap_load_bits()
1035 bdrv_dirty_bitmap_name(s->bitmap)); in dirty_bitmap_load_bits()
1040 bdrv_dirty_bitmap_deserialize_part(s->bitmap, buf, first_byte, nr_bytes, in dirty_bitmap_load_bits()
1107 error_report("Unable to read bitmap alias string"); in dirty_bitmap_load_header()
1117 error_report("Error: Unknown bitmap alias '%s' on node " in dirty_bitmap_load_header()
1130 s->bitmap = bdrv_find_dirty_bitmap(s->bs, s->bitmap_name); in dirty_bitmap_load_header()
1133 * bitmap may be NULL here, it wouldn't be an error if it is the in dirty_bitmap_load_header()
1134 * first occurrence of the bitmap in dirty_bitmap_load_header()
1136 if (!s->bitmap && !(s->flags & DIRTY_BITMAP_MIG_FLAG_START)) { in dirty_bitmap_load_header()
1137 error_report("Error: unknown dirty bitmap " in dirty_bitmap_load_header()
1143 } else if (!s->bitmap && !nothing && !s->cancelled) { in dirty_bitmap_load_header()
1154 * Load sequence of dirty bitmap chunks. Return error only on fatal io stream
1158 * Note, than when incoming bitmap migration is canceled, we still must read all
1268 register_savevm_live("dirty-bitmap", 0, 1, in dirty_bitmap_mig_init()