[PATCH v2 4/4] virsh: Add support for VIR_DOMAIN_GUEST_INFO_LOAD

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

 



Resolves: https://issues.redhat.com/browse/RHEL-71883
Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 docs/manpages/virsh.rst | 8 +++++++-
 tools/virsh-domain.c    | 6 ++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index 06c2802b3f9f..f159c40631ec 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -2930,7 +2930,7 @@ Success is always reported in this case.
 
 You can limit the types of information that are returned by specifying one or
 more flags.  Available information types flags are *--user*, *--os*,
-*--timezone*, *--hostname*, *--filesystem*, *--disk* and *--interface*.
+*--timezone*, *--hostname*, *--filesystem*, *--disk*, *--interface* and *--load*.
 If an explicitly requested information type is not supported by the guest agent
 at that point, the processes will provide an exit code of 1.
 
@@ -3009,6 +3009,12 @@ returned:
 * ``if.<num>.addr.<num1>.addr`` - the IP address of addr <num1>
 * ``if.<num>.addr.<num1>.prefix`` - the prefix of IP address of addr <num1>
 
+*--load* returns:
+* ``load.1m``  - average load in guest for last 1 minute
+* ``load.5m``  - average load in guest for last 5 minutes
+* ``load.15m`` - average load in guest for last 15 minutes
+
+
 guestvcpus
 ----------
 
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index cc5ae6053606..93c34c497133 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -13095,6 +13095,10 @@ static const vshCmdOptDef opts_guestinfo[] = {
      .type = VSH_OT_BOOL,
      .help = N_("report interface information"),
     },
+    {.name = "load",
+     .type = VSH_OT_BOOL,
+     .help = N_("report load averages information"),
+    },
     {.name = NULL}
 };
 
@@ -13122,6 +13126,8 @@ cmdGuestInfo(vshControl *ctl, const vshCmd *cmd)
         types |= VIR_DOMAIN_GUEST_INFO_DISKS;
     if (vshCommandOptBool(cmd, "interface"))
         types |= VIR_DOMAIN_GUEST_INFO_INTERFACES;
+    if (vshCommandOptBool(cmd, "load"))
+        types |= VIR_DOMAIN_GUEST_INFO_LOAD;
 
     if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
         return false;
-- 
2.48.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux