From: Hyman Huang(黄勇) <yong.huang(a)smartx.com>
Introduce command 'virsh domstats --dirtylimit' for reporting dirty
page rate upper limit (megabyte/s) infomation. The info is listed as
follows:
Domain: 'vm'
dirtylimit.vcpu.0.limit=10
dirtylimit.vcpu.0.current=16
dirtylimit.vcpu.1.limit=10
dirtylimit.vcpu.1.current=0
...
Signed-off-by: Hyman Huang(黄勇) <yong.huang(a)smartx.com>
---
docs/manpages/virsh.rst | 12 ++++++++++--
tools/virsh-domain-monitor.c | 7 +++++++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 33a8f3b9fe..5bd06cb3a5 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -2317,7 +2317,7 @@ domstats
domstats [--raw] [--enforce] [--backing] [--nowait] [--state]
[--cpu-total] [--balloon] [--vcpu] [--interface]
[--block] [--perf] [--iothread] [--memory] [--dirtyrate] [--vm]
- [[--list-active] [--list-inactive]
+ [--dirtylimit] [[--list-active] [--list-inactive]
[--list-persistent] [--list-transient] [--list-running]y
[--list-paused] [--list-shutoff] [--list-other]] | [domain ...]
@@ -2336,7 +2336,7 @@ The individual statistics groups are selectable via specific flags.
By
default all supported statistics groups are returned. Supported
statistics groups flags are: *--state*, *--cpu-total*, *--balloon*,
*--vcpu*, *--interface*, *--block*, *--perf*, *--iothread*, *--memory*,
-*--dirtyrate*, *--vm*.
+*--dirtyrate*, *--vm*, *--dirtylimit*.
Note that - depending on the hypervisor type and version or the domain state
- not all of the following statistics may be returned.
@@ -2579,6 +2579,14 @@ not available for statistical purposes.
The *--vm* option enables reporting of hypervisor-specific statistics. Naming
and meaning of the fields is entirely hypervisor dependent.
+
+*--dirtylimit* returns:
+
+* ``dirtylimit.vcpu.<num>.limit`` - the upper limit of dirty page rate for a
+ virtual CPU in megabyte/s
+* ``dirtylimit.vcpu.<num>.current`` - the dirty page rate for a virtual CPU
+ currently in megabyte/s
+
The statistics in this group have the following naming scheme:
``vm.$NAME.$TYPE``
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 89fdc7a050..efa2609719 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -2063,6 +2063,10 @@ static const vshCmdOptDef opts_domstats[] = {
.type = VSH_OT_BOOL,
.help = N_("report hypervisor-specific statistics"),
},
+ {.name = "dirtylimit",
+ .type = VSH_OT_BOOL,
+ .help = N_("report domain dirty page rate upper limit infomation"),
+ },
{.name = "list-active",
.type = VSH_OT_BOOL,
.help = N_("list only active domains"),
@@ -2187,6 +2191,9 @@ cmdDomstats(vshControl *ctl, const vshCmd *cmd)
if (vshCommandOptBool(cmd, "vm"))
stats |= VIR_DOMAIN_STATS_VM;
+ if (vshCommandOptBool(cmd, "dirtylimit"))
+ stats |= VIR_DOMAIN_STATS_DIRTYLIMIT;
+
if (vshCommandOptBool(cmd, "list-active"))
flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE;
--
2.38.5