aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@intel.com>2022-11-29 12:04:04 +0800
committerJuan Quintela <quintela@redhat.com>2023-02-06 19:22:56 +0100
commitbd9510d38546a19aa2e58e1a94597acfb0fd82d4 (patch)
tree7bc978d7b91d0460697e471ef9f3ff92020b0a09
parentbb25a7289561d67133a7e7d69b15d81ead507a9e (diff)
migration/dirtyrate: Show sample pages only in page-sampling mode
The value of "Sample Pages" is confusing in mode other than page-sampling. See below: (qemu) calc_dirty_rate -b 10 520 (qemu) info dirty_rate Status: measuring Start Time: 11646834 (ms) Sample Pages: 520 (per GB) Period: 10 (sec) Mode: dirty-bitmap Dirty rate: (not ready) (qemu) info dirty_rate Status: measured Start Time: 11646834 (ms) Sample Pages: 0 (per GB) Period: 10 (sec) Mode: dirty-bitmap Dirty rate: 2 (MB/s) While it's totally useless in dirty-ring and dirty-bitmap mode, fix to show it only in page-sampling mode. Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
-rw-r--r--migration/dirtyrate.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index 4bfb97fc68..575d48c397 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -714,8 +714,8 @@ void qmp_calc_dirty_rate(int64_t calc_time,
mode = DIRTY_RATE_MEASURE_MODE_PAGE_SAMPLING;
}
- if (has_sample_pages && mode == DIRTY_RATE_MEASURE_MODE_DIRTY_RING) {
- error_setg(errp, "either sample-pages or dirty-ring can be specified.");
+ if (has_sample_pages && mode != DIRTY_RATE_MEASURE_MODE_PAGE_SAMPLING) {
+ error_setg(errp, "sample-pages is used only in page-sampling mode");
return;
}
@@ -785,8 +785,10 @@ void hmp_info_dirty_rate(Monitor *mon, const QDict *qdict)
DirtyRateStatus_str(info->status));
monitor_printf(mon, "Start Time: %"PRIi64" (ms)\n",
info->start_time);
- monitor_printf(mon, "Sample Pages: %"PRIu64" (per GB)\n",
- info->sample_pages);
+ if (info->mode == DIRTY_RATE_MEASURE_MODE_PAGE_SAMPLING) {
+ monitor_printf(mon, "Sample Pages: %"PRIu64" (per GB)\n",
+ info->sample_pages);
+ }
monitor_printf(mon, "Period: %"PRIi64" (sec)\n",
info->calc_time);
monitor_printf(mon, "Mode: %s\n",