From nobody Mon Feb 9 05:45:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661534459; cv=none; d=zohomail.com; s=zohoarc; b=nqj/nSxUiWwMrlLNvrqEsioMfQ4oRcAX3VLBT5za63eM4l0jVL5vHqsJ6D/ZCvLlx2aENtJRzsKIAPnzJ1RHs6yvbQ3/EJlzRrrrLX7Czd4l+GavYDJ5SiVZ8d8javPx1u290/ZV3zvZYd8H5zX2J1wUew2Q/w50aDpQW2/rNyM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661534459; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RWX83LODPS07CWmJPAk7+CCac6GIYHF9eP35K4trSOA=; b=OOU3Wwu42uXAMtAmpee2Jpd9RaMxPtITaWKg/iQKpoUryfFoqCB1vBQlQOl/fg/y4wC4y4HXRITlaO6gWx7AQVPc+EBkUuQpvqdT/CqeE74evPP4CaChlDxHiBde5cUde5vSyCZH7LXFDCd3ygUojlYUuSsFkt6EDL1Ve4eNE98= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1661534459156301.734604669403; Fri, 26 Aug 2022 10:20:59 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-662-Xulht2dcPoyIZP4bhxYI0A-1; Fri, 26 Aug 2022 13:20:53 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 346942806AA0; Fri, 26 Aug 2022 17:20:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 202162166B26; Fri, 26 Aug 2022 17:20:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 10C3F1946A4C; Fri, 26 Aug 2022 17:20:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6B17D1946A43 for ; Fri, 26 Aug 2022 17:20:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4FF232166B29; Fri, 26 Aug 2022 17:20:46 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C2452166B26 for ; Fri, 26 Aug 2022 17:20:46 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2F17B85A58D for ; Fri, 26 Aug 2022 17:20:46 +0000 (UTC) Received: from chinatelecom.cn (prt-mail.chinatelecom.cn [42.123.76.222]) by relay.mimecast.com with ESMTP id us-mta-55-XU75gC_ePMewPHglTt9n7A-1; Fri, 26 Aug 2022 13:20:41 -0400 Received: from clientip-118.116.19.131 (unknown [172.18.0.48]) by chinatelecom.cn (HERMES) with SMTP id B79622800BD; Sat, 27 Aug 2022 01:20:38 +0800 (CST) Received: from ([172.18.0.48]) by app0024 with ESMTP id e7ecd206b90c4f02bc1ae6bcfe892e93 for libvir-list@redhat.com; Sat, 27 Aug 2022 01:20:39 CST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661534458; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:in-reply-to:references:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=RWX83LODPS07CWmJPAk7+CCac6GIYHF9eP35K4trSOA=; b=OG8wDtAYqhAXlEsOoKIqeO/F0ffP3vkhLX1H654x+1LNIvBtiS37dWbFQOSjKGkwnGGu5R 3v9IkGa2rZVbY1FpLj8PKnZNxPzBteN/hwMX74uyeHlbvHZWPAt6bCX//dmFrbBYLUTxsA Nc0qaG2J+Fz++Jm+22HhMZjnFXR5jWE= X-MC-Unique: Xulht2dcPoyIZP4bhxYI0A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: XU75gC_ePMewPHglTt9n7A-1 HMM_SOURCE_IP: 172.18.0.48:55710.1634875554 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP X-189-SAVE-TO-SEND: +huangy81@chinatelecom.cn X-Transaction-ID: e7ecd206b90c4f02bc1ae6bcfe892e93 X-Real-From: huangy81@chinatelecom.cn X-Receive-IP: 172.18.0.48 X-MEDUSA-Status: 0 From: huangy81@chinatelecom.cn To: Subject: [PATCH v1 07/10] virsh: Extend vcpuinfo api to display dirtylimit info Date: Sat, 27 Aug 2022 01:20:11 +0800 Message-Id: In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?= Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661534459682100001 Content-Type: text/plain; charset="utf-8" From: Hyman Huang(=E9=BB=84=E5=8B=87) Extend vcpuinfo api so that 'virsh vcpuinfo domain' can display dirtylimit info for active virtual cpu, which can be set by using 'virsh vcpudirtylimit'. Signed-off-by: Hyman Huang(=E9=BB=84=E5=8B=87) --- src/remote/remote_daemon_dispatch.c | 2 ++ src/remote/remote_driver.c | 2 ++ src/remote/remote_protocol.x | 2 ++ tools/virsh-domain.c | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index dc5790f..9d6b66c 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -2891,6 +2891,8 @@ remoteDispatchDomainGetVcpus(virNetServer *server G_G= NUC_UNUSED, ret->info.info_val[i].state =3D info[i].state; ret->info.info_val[i].cpu_time =3D info[i].cpuTime; ret->info.info_val[i].cpu =3D info[i].cpu; + ret->info.info_val[i].limit =3D info[i].limit; + ret->info.info_val[i].current =3D info[i].current; } =20 /* Don't need to allocate/copy the cpumaps if we make the reasonable diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index f673fed..5fc1a61 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -2201,6 +2201,8 @@ remoteDomainGetVcpus(virDomainPtr domain, info[i].state =3D ret.info.info_val[i].state; info[i].cpuTime =3D ret.info.info_val[i].cpu_time; info[i].cpu =3D ret.info.info_val[i].cpu; + info[i].limit =3D ret.info.info_val[i].limit; + info[i].current =3D ret.info.info_val[i].current; } =20 for (i =3D 0; i < ret.cpumaps.cpumaps_len; ++i) diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index e6c18a4..874ce19 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -416,6 +416,8 @@ struct remote_vcpu_info { int state; unsigned hyper cpu_time; int cpu; + unsigned hyper limit; + unsigned hyper current; }; =20 /* Wire encoding of virTypedParameter. diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 8705090..08fe259 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6935,6 +6935,11 @@ cmdVcpuinfo(vshControl *ctl, const vshCmd *cmd) maxcpu, pretty) < 0) return false; =20 + if (cpuinfo[n].limit !=3D 0) { + vshPrint(ctl, "%-15s %lld\n", _("DirtyRate limit:"), cpuinfo[n= ].limit); + vshPrint(ctl, "%-15s %lld\n", _("DirtyRate current:"), cpuinfo= [n].current); + } + if (n < (ncpus - 1)) vshPrint(ctl, "\n"); } --=20 1.8.3.1