[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 35/36] migration: expose the bitmap_sync_count to th
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 35/36] migration: expose the bitmap_sync_count to the end |
Date: |
Mon, 5 May 2014 22:30:33 +0200 |
From: ChenLiang <address@hidden>
expose the count that logs the times of updating the dirty bitmap to
end user.
Signed-off-by: ChenLiang <address@hidden>
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
arch_init.c | 1 +
hmp.c | 2 ++
include/migration/migration.h | 1 +
migration.c | 2 ++
qapi-schema.json | 4 +++-
qmp-commands.hx | 13 +++++++++----
6 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index c02bce6..5f05e99 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -537,6 +537,7 @@ static void migration_bitmap_sync(void)
s->dirty_bytes_rate = s->dirty_pages_rate * TARGET_PAGE_SIZE;
start_time = end_time;
num_dirty_pages_period = 0;
+ s->dirty_sync_count = bitmap_sync_count;
}
}
diff --git a/hmp.c b/hmp.c
index ca869ba..69a70e4 100644
--- a/hmp.c
+++ b/hmp.c
@@ -188,6 +188,8 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
info->ram->normal);
monitor_printf(mon, "normal bytes: %" PRIu64 " kbytes\n",
info->ram->normal_bytes >> 10);
+ monitor_printf(mon, "dirty sync count: %" PRIu64 "\n",
+ info->ram->dirty_sync_count);
if (info->ram->dirty_pages_rate) {
monitor_printf(mon, "dirty pages rate: %" PRIu64 " pages\n",
info->ram->dirty_pages_rate);
diff --git a/include/migration/migration.h b/include/migration/migration.h
index 31fbf17..8d88c7d 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -61,6 +61,7 @@ struct MigrationState
bool enabled_capabilities[MIGRATION_CAPABILITY_MAX];
int64_t xbzrle_cache_size;
int64_t setup_time;
+ int64_t dirty_sync_count;
};
void process_incoming_migration(QEMUFile *f);
diff --git a/migration.c b/migration.c
index ac23275..2cb768d 100644
--- a/migration.c
+++ b/migration.c
@@ -215,6 +215,7 @@ MigrationInfo *qmp_query_migrate(Error **errp)
info->ram->normal_bytes = norm_mig_bytes_transferred();
info->ram->dirty_pages_rate = s->dirty_pages_rate;
info->ram->mbps = s->mbps;
+ info->ram->dirty_sync_count = s->dirty_sync_count;
if (blk_mig_active()) {
info->has_disk = true;
@@ -248,6 +249,7 @@ MigrationInfo *qmp_query_migrate(Error **errp)
info->ram->normal = norm_mig_pages_transferred();
info->ram->normal_bytes = norm_mig_bytes_transferred();
info->ram->mbps = s->mbps;
+ info->ram->dirty_sync_count = s->dirty_sync_count;
break;
case MIG_STATE_ERROR:
info->has_status = true;
diff --git a/qapi-schema.json b/qapi-schema.json
index 0b00427..7b95039 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -651,13 +651,15 @@
#
# @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
##
{ 'type': 'MigrationStats',
'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
- 'mbps' : 'number' } }
+ 'mbps' : 'number', 'dirty-sync-count' : 'int' } }
##
# @XBZRLECacheStats
diff --git a/qmp-commands.hx b/qmp-commands.hx
index ed3ab92..aadcd04 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2967,6 +2967,7 @@ The main json-object contains the following:
pages. This is just normal pages times size of one page,
but this way upper levels don't need to care about page
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,
it is a json-object with the following disk information:
- "transferred": amount transferred in bytes (json-int)
@@ -3004,7 +3005,8 @@ Examples:
"downtime":12345,
"duplicate":123,
"normal":123,
- "normal-bytes":123456
+ "normal-bytes":123456,
+ "dirty-sync-count":15
}
}
}
@@ -3029,7 +3031,8 @@ Examples:
"expected-downtime":12345,
"duplicate":123,
"normal":123,
- "normal-bytes":123456
+ "normal-bytes":123456,
+ "dirty-sync-count":15
}
}
}
@@ -3049,7 +3052,8 @@ Examples:
"expected-downtime":12345,
"duplicate":123,
"normal":123,
- "normal-bytes":123456
+ "normal-bytes":123456,
+ "dirty-sync-count":15
},
"disk":{
"total":20971520,
@@ -3075,7 +3079,8 @@ Examples:
"expected-downtime":12345,
"duplicate":10,
"normal":3333,
- "normal-bytes":3412992
+ "normal-bytes":3412992,
+ "dirty-sync-count":15
},
"xbzrle-cache":{
"cache-size":67108864,
--
1.9.0
- [Qemu-devel] [PATCH 27/36] Make qemu_peek_buffer loop until it gets it's data, (continued)
- [Qemu-devel] [PATCH 27/36] Make qemu_peek_buffer loop until it gets it's data, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 26/36] Disallow outward migration while awaiting incoming migration, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 25/36] virtio: validate config_len on load, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 30/36] Init the XBZRLE.lock in ram_mig_init, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 28/36] Count used RAMBlock pages for migration_dirty_pages, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 29/36] Provide init function for ram migration, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 31/36] Coverity: Fix failure path for qemu_accept in migration, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 32/36] migration: remove duplicate code, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 33/36] XBZRLE: Fix one XBZRLE corruption issues, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 34/36] migration: Add counts of updating the dirty bitmap, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 35/36] migration: expose the bitmap_sync_count to the end,
Juan Quintela <=
- [Qemu-devel] [PATCH 36/36] migration: expose xbzrle cache miss rate, Juan Quintela, 2014/05/05
- [Qemu-devel] [PATCH 02/36] vmstate: add VMS_MUST_EXIST, Juan Quintela, 2014/05/05
- Re: [Qemu-devel] [PULL 00/36] migration queue, Peter Maydell, 2014/05/07