mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
Add XBZRLE statistics
Signed-off-by: Benoit Hudzia <benoit.hudzia@sap.com> Signed-off-by: Petter Svard <petters@cs.umu.se> Signed-off-by: Aidan Shribman <aidan.shribman@sap.com> Signed-off-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
004d4c10ae
commit
f36d55af74
6 changed files with 122 additions and 2 deletions
17
migration.c
17
migration.c
|
@ -141,6 +141,19 @@ MigrationCapabilityStatusList *qmp_query_migrate_capabilities(Error **errp)
|
|||
return head;
|
||||
}
|
||||
|
||||
static void get_xbzrle_cache_stats(MigrationInfo *info)
|
||||
{
|
||||
if (migrate_use_xbzrle()) {
|
||||
info->has_xbzrle_cache = true;
|
||||
info->xbzrle_cache = g_malloc0(sizeof(*info->xbzrle_cache));
|
||||
info->xbzrle_cache->cache_size = migrate_xbzrle_cache_size();
|
||||
info->xbzrle_cache->bytes = xbzrle_mig_bytes_transferred();
|
||||
info->xbzrle_cache->pages = xbzrle_mig_pages_transferred();
|
||||
info->xbzrle_cache->cache_miss = xbzrle_mig_pages_cache_miss();
|
||||
info->xbzrle_cache->overflow = xbzrle_mig_pages_overflow();
|
||||
}
|
||||
}
|
||||
|
||||
MigrationInfo *qmp_query_migrate(Error **errp)
|
||||
{
|
||||
MigrationInfo *info = g_malloc0(sizeof(*info));
|
||||
|
@ -172,8 +185,12 @@ MigrationInfo *qmp_query_migrate(Error **errp)
|
|||
info->disk->remaining = blk_mig_bytes_remaining();
|
||||
info->disk->total = blk_mig_bytes_total();
|
||||
}
|
||||
|
||||
get_xbzrle_cache_stats(info);
|
||||
break;
|
||||
case MIG_STATE_COMPLETED:
|
||||
get_xbzrle_cache_stats(info);
|
||||
|
||||
info->has_status = true;
|
||||
info->status = g_strdup("completed");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue