migration: expose the bitmap_sync_count to the end

expose the count that logs the times of updating the dirty bitmap to
end user.

Signed-off-by: ChenLiang <chenliang88@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
ChenLiang 2014-04-04 17:57:55 +08:00 committed by Juan Quintela
parent 71411d3580
commit 58570ed894
6 changed files with 18 additions and 5 deletions

View File

@ -537,6 +537,7 @@ static void migration_bitmap_sync(void)
s->dirty_bytes_rate = s->dirty_pages_rate * TARGET_PAGE_SIZE; s->dirty_bytes_rate = s->dirty_pages_rate * TARGET_PAGE_SIZE;
start_time = end_time; start_time = end_time;
num_dirty_pages_period = 0; num_dirty_pages_period = 0;
s->dirty_sync_count = bitmap_sync_count;
} }
} }

2
hmp.c
View File

@ -188,6 +188,8 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
info->ram->normal); info->ram->normal);
monitor_printf(mon, "normal bytes: %" PRIu64 " kbytes\n", monitor_printf(mon, "normal bytes: %" PRIu64 " kbytes\n",
info->ram->normal_bytes >> 10); info->ram->normal_bytes >> 10);
monitor_printf(mon, "dirty sync count: %" PRIu64 "\n",
info->ram->dirty_sync_count);
if (info->ram->dirty_pages_rate) { if (info->ram->dirty_pages_rate) {
monitor_printf(mon, "dirty pages rate: %" PRIu64 " pages\n", monitor_printf(mon, "dirty pages rate: %" PRIu64 " pages\n",
info->ram->dirty_pages_rate); info->ram->dirty_pages_rate);

View File

@ -61,6 +61,7 @@ struct MigrationState
bool enabled_capabilities[MIGRATION_CAPABILITY_MAX]; bool enabled_capabilities[MIGRATION_CAPABILITY_MAX];
int64_t xbzrle_cache_size; int64_t xbzrle_cache_size;
int64_t setup_time; int64_t setup_time;
int64_t dirty_sync_count;
}; };
void process_incoming_migration(QEMUFile *f); void process_incoming_migration(QEMUFile *f);

View File

@ -215,6 +215,7 @@ MigrationInfo *qmp_query_migrate(Error **errp)
info->ram->normal_bytes = norm_mig_bytes_transferred(); info->ram->normal_bytes = norm_mig_bytes_transferred();
info->ram->dirty_pages_rate = s->dirty_pages_rate; info->ram->dirty_pages_rate = s->dirty_pages_rate;
info->ram->mbps = s->mbps; info->ram->mbps = s->mbps;
info->ram->dirty_sync_count = s->dirty_sync_count;
if (blk_mig_active()) { if (blk_mig_active()) {
info->has_disk = true; info->has_disk = true;
@ -248,6 +249,7 @@ MigrationInfo *qmp_query_migrate(Error **errp)
info->ram->normal = norm_mig_pages_transferred(); info->ram->normal = norm_mig_pages_transferred();
info->ram->normal_bytes = norm_mig_bytes_transferred(); info->ram->normal_bytes = norm_mig_bytes_transferred();
info->ram->mbps = s->mbps; info->ram->mbps = s->mbps;
info->ram->dirty_sync_count = s->dirty_sync_count;
break; break;
case MIG_STATE_ERROR: case MIG_STATE_ERROR:
info->has_status = true; info->has_status = true;

View File

@ -651,13 +651,15 @@
# #
# @mbps: throughput in megabits/sec. (since 1.6) # @mbps: throughput in megabits/sec. (since 1.6)
# #
# @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
#
# Since: 0.14.0 # Since: 0.14.0
## ##
{ 'type': 'MigrationStats', { 'type': 'MigrationStats',
'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' , 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
'duplicate': 'int', 'skipped': 'int', 'normal': 'int', 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
'normal-bytes': 'int', 'dirty-pages-rate' : 'int', 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
'mbps' : 'number' } } 'mbps' : 'number', 'dirty-sync-count' : 'int' } }
## ##
# @XBZRLECacheStats # @XBZRLECacheStats

View File

@ -2967,6 +2967,7 @@ The main json-object contains the following:
pages. This is just normal pages times size of one page, pages. This is just normal pages times size of one page,
but this way upper levels don't need to care about page but this way upper levels don't need to care about page
size (json-int) size (json-int)
- "dirty-sync-count": times that dirty ram was synchronized (json-int)
- "disk": only present if "status" is "active" and it is a block migration, - "disk": only present if "status" is "active" and it is a block migration,
it is a json-object with the following disk information: it is a json-object with the following disk information:
- "transferred": amount transferred in bytes (json-int) - "transferred": amount transferred in bytes (json-int)
@ -3004,7 +3005,8 @@ Examples:
"downtime":12345, "downtime":12345,
"duplicate":123, "duplicate":123,
"normal":123, "normal":123,
"normal-bytes":123456 "normal-bytes":123456,
"dirty-sync-count":15
} }
} }
} }
@ -3029,7 +3031,8 @@ Examples:
"expected-downtime":12345, "expected-downtime":12345,
"duplicate":123, "duplicate":123,
"normal":123, "normal":123,
"normal-bytes":123456 "normal-bytes":123456,
"dirty-sync-count":15
} }
} }
} }
@ -3049,7 +3052,8 @@ Examples:
"expected-downtime":12345, "expected-downtime":12345,
"duplicate":123, "duplicate":123,
"normal":123, "normal":123,
"normal-bytes":123456 "normal-bytes":123456,
"dirty-sync-count":15
}, },
"disk":{ "disk":{
"total":20971520, "total":20971520,
@ -3075,7 +3079,8 @@ Examples:
"expected-downtime":12345, "expected-downtime":12345,
"duplicate":10, "duplicate":10,
"normal":3333, "normal":3333,
"normal-bytes":3412992 "normal-bytes":3412992,
"dirty-sync-count":15
}, },
"xbzrle-cache":{ "xbzrle-cache":{
"cache-size":67108864, "cache-size":67108864,