]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Add support for VIR_DOMAIN_GUEST_INFO_LOAD
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 25 Feb 2025 14:22:35 +0000 (15:22 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 3 Mar 2025 13:27:45 +0000 (14:27 +0100)
Resolves: https://issues.redhat.com/browse/RHEL-71883
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
docs/manpages/virsh.rst
tools/virsh-domain.c

index 06c2802b3f9fc5b1658c0e80508e11a9c5e5102b..f159c40631ec5e55cc6c73ceb3fd8b7b54a26912 100644 (file)
@@ -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
 ----------
 
index cc5ae6053606be6706c73e24da7089e7bd6ff4b4..93c34c497133339c4220a03403faaf962573ba94 100644 (file)
@@ -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;