From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, alex.bennee@linaro.org,
zhengchuan@huawei.com, stefanha@redhat.com, peterx@redhat.com
Cc: quintela@redhat.com
Subject: [PULL 10/10] migration/dirtyrate: present dirty rate only when querying the rate has completed
Date: Thu, 8 Oct 2020 20:10:46 +0100 [thread overview]
Message-ID: <20201008191046.272549-11-dgilbert@redhat.com> (raw)
In-Reply-To: <20201008191046.272549-1-dgilbert@redhat.com>
From: Chuan Zheng <zhengchuan@huawei.com>
Make dirty_rate field optional, present dirty rate only when querying
the rate has completed.
The qmp results is shown as follow:
@unstarted:
{"return":{"status":"unstarted","start-time":0,"calc-time":0},"id":"libvirt-12"}
@measuring:
{"return":{"status":"measuring","start-time":102931,"calc-time":1},"id":"libvirt-85"}
@measured:
{"return":{"status":"measured","dirty-rate":4,"start-time":150146,"calc-time":1},"id":"libvirt-15"}
Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Message-Id: <1601350938-128320-3-git-send-email-zhengchuan@huawei.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/dirtyrate.c | 3 +--
qapi/migration.json | 8 +++-----
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index 40e41e793e..ab9e1301f6 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -69,9 +69,8 @@ static struct DirtyRateInfo *query_dirty_rate_info(void)
struct DirtyRateInfo *info = g_malloc0(sizeof(DirtyRateInfo));
if (qatomic_read(&CalculatingState) == DIRTY_RATE_STATUS_MEASURED) {
+ info->has_dirty_rate = true;
info->dirty_rate = dirty_rate;
- } else {
- info->dirty_rate = -1;
}
info->status = CalculatingState;
diff --git a/qapi/migration.json b/qapi/migration.json
index 7f5e6fd681..974021a5c8 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1743,10 +1743,8 @@
#
# Information about current dirty page rate of vm.
#
-# @dirty-rate: @dirtyrate describing the dirty page rate of vm
-# in units of MB/s.
-# If this field returns '-1', it means querying has not
-# yet started or completed.
+# @dirty-rate: an estimate of the dirty page rate of the VM in units of
+# MB/s, present only when estimating the rate has completed.
#
# @status: status containing dirtyrate query status includes
# 'unstarted' or 'measuring' or 'measured'
@@ -1759,7 +1757,7 @@
#
##
{ 'struct': 'DirtyRateInfo',
- 'data': {'dirty-rate': 'int64',
+ 'data': {'*dirty-rate': 'int64',
'status': 'DirtyRateStatus',
'start-time': 'int64',
'calc-time': 'int64'} }
--
2.28.0
next prev parent reply other threads:[~2020-10-08 19:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 19:10 [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
2020-10-08 19:10 ` [PULL 01/10] virtiofsd: Silence gcc warning Dr. David Alan Gilbert (git)
2020-10-08 19:10 ` [PULL 02/10] tools/virtiofsd: add support for --socket-group Dr. David Alan Gilbert (git)
2020-10-08 19:10 ` [PULL 03/10] virtiofsd: Call qemu_init_exec_dir Dr. David Alan Gilbert (git)
2020-10-08 19:10 ` [PULL 04/10] virtiofsd: avoid /proc/self/fd tempdir Dr. David Alan Gilbert (git)
2020-10-08 19:10 ` [PULL 05/10] migration: Pass incoming state into qemu_ufd_copy_ioctl() Dr. David Alan Gilbert (git)
2020-10-08 19:10 ` [PULL 06/10] migration: Introduce migrate_send_rp_message_req_pages() Dr. David Alan Gilbert (git)
2020-10-08 19:10 ` [PULL 07/10] migration: Maintain postcopy faulted addresses Dr. David Alan Gilbert (git)
2020-10-08 19:10 ` [PULL 08/10] migration: Sync requested pages after postcopy recovery Dr. David Alan Gilbert (git)
2020-10-08 19:10 ` [PULL 09/10] migration/dirtyrate: record start_time and calc_time while at the measuring state Dr. David Alan Gilbert (git)
2020-10-08 19:10 ` Dr. David Alan Gilbert (git) [this message]
2020-10-11 18:29 ` [PULL 00/10] migration queue Peter Maydell
2020-10-12 8:12 ` Dr. David Alan Gilbert
2020-10-14 20:01 ` Peter Xu
2020-10-15 9:13 ` Thomas Huth
2020-10-15 18:58 ` Peter Xu
-- strict thread matches above, loose matches on Subject: below --
2020-10-07 15:55 Dr. David Alan Gilbert (git)
2020-10-07 15:56 ` [PULL 10/10] migration/dirtyrate: present dirty rate only when querying the rate has completed Dr. David Alan Gilbert (git)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201008191046.272549-11-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
--cc=zhengchuan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).