[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/2] virsh: add block group for bulk stats.



Add "--block" option to "domstats" command for querying block stats.

Signed-off-by: Li Wei <lw cn fujitsu com>
---
 tools/virsh-domain-monitor.c | 7 +++++++
 tools/virsh.pod              | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 055d8d2..67efd61 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -1972,6 +1972,10 @@ static const vshCmdOptDef opts_domstats[] = {
      .type = VSH_OT_BOOL,
      .help = N_("report domain state"),
     },
+    {.name = "block",
+     .type = VSH_OT_BOOL,
+     .help = N_("report block device stats"),
+    },
     {.name = "list-active",
      .type = VSH_OT_BOOL,
      .help = N_("list only active domains"),
@@ -2063,6 +2067,9 @@ cmdDomstats(vshControl *ctl, const vshCmd *cmd)
     if (vshCommandOptBool(cmd, "state"))
         stats |= VIR_DOMAIN_STATS_STATE;
 
+    if (vshCommandOptBool(cmd, "block"))
+        stats |= VIR_DOMAIN_STATS_BLOCK;
+
     if (vshCommandOptBool(cmd, "list-active"))
         flags |= VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE;
 
diff --git a/tools/virsh.pod b/tools/virsh.pod
index ea9267e..7d57f6b 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -813,7 +813,7 @@ that require a block device name (such as I<domblkinfo> or
 I<snapshot-create> for disk snapshots) will accept either target
 or unique source names printed by this command.
 
-=item B<domstats> [I<--raw>] [I<--enforce>] [I<--state>]
+=item B<domstats> [I<--raw>] [I<--enforce>] [I<--state>] [I<--block>]
 [[I<--list-active>] [I<--list-inactive>] [I<--list-persistent>]
 [I<--list-transient>] [I<--list-running>] [I<--list-paused>]
 [I<--list-shutoff>] [I<--list-other>]] | [I<domain> ...]
@@ -831,7 +831,7 @@ behavior use the I<--raw> flag.
 
 The individual statistics groups are selectable via specific flags. By
 default all supported statistics groups are returned. Supported
-statistics groups flags are: I<--state>.
+statistics groups flags are: I<--state>, I<--block>.
 
 Selecting a specific statistics groups doesn't guarantee that the
 daemon supports the selected group of stats. Flag I<--enforce>
-- 
1.9.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]