From nobody Wed Mar 12 17:56:44 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 174049879763766.91691980967255; Tue, 25 Feb 2025 07:53:17 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 869F5214F; Tue, 25 Feb 2025 10:53:16 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 288381EEA; Tue, 25 Feb 2025 10:52:03 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 9F2521D52; Tue, 25 Feb 2025 10:51:51 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id CD8821F0B for ; Tue, 25 Feb 2025 10:51:41 -0500 (EST) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-632-FCEOoO2KNs6Ex7o4pZbFiA-1; Tue, 25 Feb 2025 10:51:40 -0500 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-38f628ff78eso3092438f8f.1 for ; Tue, 25 Feb 2025 07:51:39 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b02f5b38sm145807375e9.24.2025.02.25.07.51.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 07:51:38 -0800 (PST) Received: from wheatley.pinto-pinecone.ts.net (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 2E4268CC8005 for ; Tue, 25 Feb 2025 15:52:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740498701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nPusiFR8Tc8Rt+DYayc/jASRAHA044oe45GifC/0jnM=; b=AmYuJTP/A0EXJ+WzW3+MPy34lizfmwygatsKqMqw9ArFW8UGrE2ccY/R+DtSF4s9GSDMnJ Zvlrhb2a36d4WtC2t7oXzKkMuYK9WJzgksFjfzeBiANfDpft6lvJLBQmZlcWPeaoyyQye2 C+Slr6nfLkdOTJVpWfz+5RYXuDFuxv0= X-MC-Unique: FCEOoO2KNs6Ex7o4pZbFiA-1 X-Mimecast-MFC-AGG-ID: FCEOoO2KNs6Ex7o4pZbFiA_1740498699 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740498699; x=1741103499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nPusiFR8Tc8Rt+DYayc/jASRAHA044oe45GifC/0jnM=; b=KDuYlbK7I365t7RaxFajnNe4HUk/AjK4ivAaLS+UtibsOYBR2LOKc0iOs058D4F4mh 57Drj/npouAc8K7oxrbixY+Ix7nV+dbypCmhaLUm7Ze0DYmMTxNv4sEYFHwlmi+5FmZB m3PxKYDgfbzT7H7T97Nr9/xWCf5ka4RwXbizwiRu1jICBrhCv30Hehj8A+TZV/FqFFFQ uaJygSOFoIVU8nIKrQl0SBAI1N+TBh6/gETA3zJaccyNNylBMyJaNoJ0bedICTasWybc TfAaGXMc9QG7moIqvGsze0YK0oejr39hIlX6orf7SLtcqQ/q7nNlbzjggHa/WIiuI7d0 txeQ== X-Gm-Message-State: AOJu0Yy+8N1mahJTF2QSt7aHIIOK2VdjyFZayULcNrddwIOwzo7EXWwW nZkd110YOwvadf+hbnphOoCck2ZRHUguDzX4KwUO7my5H6Ikkpk2fDh9KyepUoLX0pzQMvqNMQx 3FU4tfpFE3mvJXkhfM8pc8Ke393wi5w5x/uEVLxAJkXoYiRCJaLlIbK6v+LjWfGy5YnO3NG2wji uHb7QJ7N/hqJQ18pqxBEQboQgzyGyHi9IbuYxplko= X-Gm-Gg: ASbGncvQspYDNsXfkmLiIBCoz4UD2aNpVIw79eGqcgKDW3EYeceRAtny5fypfelRp2y ecB19TQf76NZW9QhIQfffHIoqvKRpfGgUbaLzHpgStBqAgxHzAh57CZWPPkxB5lJNKNW+B4YJHe mstXz5yTPZIzxRGjycRcRmP6UF/0RP27ktRGdw73zMclbeLk4drBqP9iof0BonV8pm/K0NmWCMT 445/RLTdkLWQk+w+m8MANl4+4wanxeG7TR0E+Y1Us5djcsswcquH2I+0CgJ7/OacOqVeyRV/MRJ tZij8/vZ8MLsHV2/8v2po0cKw7sUis8kz0k8vmv/HjDj9OOGc20= X-Received: by 2002:a05:6000:1a87:b0:38f:3ec3:4801 with SMTP id ffacd0b85a97d-38f616323bamr20094426f8f.25.1740498698782; Tue, 25 Feb 2025 07:51:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IElcGd1vF4dvGNalLxbS5VfW3C6UXGJ8ccIenH6ZuwjUkRzcDTYhbF4+5mH9ex9+CVDalpXQA== X-Received: by 2002:a05:6000:1a87:b0:38f:3ec3:4801 with SMTP id ffacd0b85a97d-38f616323bamr20094411f8f.25.1740498698348; Tue, 25 Feb 2025 07:51:38 -0800 (PST) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH v2 4/4] virsh: Add support for VIR_DOMAIN_GUEST_INFO_LOAD Date: Tue, 25 Feb 2025 15:52:32 +0100 Message-ID: <3522f41495cd4a3686ee39db9297ee7cf8297f52.1740494984.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: MuJJH3AU4rPX3Zxss8NXrooeX3UmwSG63sBNzLGJttI_1740498699 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2EHGPL3TCKV7MGM3DYQX5YYBGLTDRFDL X-Message-ID-Hash: 2EHGPL3TCKV7MGM3DYQX5YYBGLTDRFDL X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1740498799087019100 Content-Type: text/plain; charset="utf-8"; x-default="true" Resolves: https://issues.redhat.com/browse/RHEL-71883 Signed-off-by: Martin Kletzander --- 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. =20 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. =20 @@ -3009,6 +3009,12 @@ returned: * ``if..addr..addr`` - the IP address of addr * ``if..addr..prefix`` - the prefix of IP address of addr =20 +*--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 ---------- =20 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[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("report interface information"), }, + {.name =3D "load", + .type =3D VSH_OT_BOOL, + .help =3D N_("report load averages information"), + }, {.name =3D NULL} }; =20 @@ -13122,6 +13126,8 @@ cmdGuestInfo(vshControl *ctl, const vshCmd *cmd) types |=3D VIR_DOMAIN_GUEST_INFO_DISKS; if (vshCommandOptBool(cmd, "interface")) types |=3D VIR_DOMAIN_GUEST_INFO_INTERFACES; + if (vshCommandOptBool(cmd, "load")) + types |=3D VIR_DOMAIN_GUEST_INFO_LOAD; =20 if (!(dom =3D virshCommandOptDomain(ctl, cmd, NULL))) return false; --=20 2.48.1