From nobody Sat May 18 21:16:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1662478080; cv=none; d=zohomail.com; s=zohoarc; b=GCzy3sjjId/zZXxL4b24lFruILzvuWcA1072EXuzOYcX+8lc8+AETzxwdZCrBDzaRykfV3/vJjSf3Fb/SDIb0sql6i94XaWArx390Ky5o9ojShWFmLq63heDl2n20STyzlVLwIbrSQ0TPMe01EB/2V1Rh+psg3S6S41mqOCXPD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662478080; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ONBk7frLPKYQad9PDreubsOA7GWmqtxAtxcZWnKZ5N0=; b=BDwn4AcxBm61iHq+VtkQes6BKLt4TDOFk6w4SSqNb4G4GTOw/LoWXnj+SgF4kgycBQn7rW6CwXg8wEcIdWAaU8jNTxjC3vAWLqo3dP5P0b9qX+WnbTubx9Wo4ogLcJTAURqaReLMsZdmQrFATWxpetyV01yrhTYewFtw5tTOlRo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1662478080874468.44203306033114; Tue, 6 Sep 2022 08:28:00 -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-101-ijqdI679M7Kb84DnKAeWCg-1; Tue, 06 Sep 2022 11:27:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 252831C20AF8; Tue, 6 Sep 2022 15:27:52 +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 D499D40CF8ED; Tue, 6 Sep 2022 15:27:50 +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 70CEE1946A43; Tue, 6 Sep 2022 15:27:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9351F1946A40 for ; Tue, 6 Sep 2022 15:27:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5F8A52026D64; Tue, 6 Sep 2022 15:27:49 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09E0A2026D4C for ; Tue, 6 Sep 2022 15:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662478079; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ONBk7frLPKYQad9PDreubsOA7GWmqtxAtxcZWnKZ5N0=; b=EqdD3upFbMHthL0KzLOx4UAa/Ys/G/LE+TMWu5afb9QoQC7lrq7Aruj5gC6xlSvAIZTekl ZOSscqVKUVf/mM20j/2Yd5oJovGGeM28toqZodgFlsFFnOA6fDcdPuQX080Rjf3qRHQxNq R29PU4U3weNLerKbV0y7QbWrXhovLvQ= X-MC-Unique: ijqdI679M7Kb84DnKAeWCg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_driver: Fix order of arguments in qemuDomainGetStatsCpuProc() Date: Tue, 6 Sep 2022 17:27:47 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1662478081451100001 Just before pushing my earlier commit I've switch order of two arguments of virProcessGetStatInfo() (as suggested in review). However, I forgot to swap the arguments in qemuDomainGetStatsCpuProc() which leads to userTime and sysTime being swapped. Fixes: 044b8744d65f8571038f85685b3c4b241162977b Reported-by: Daniel P. Berrang=C3=A9 Signed-off-by: Michal Privoznik --- Pushed as trivial. src/qemu/qemu_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c7cca64001..a3f8d8baf5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17771,10 +17771,10 @@ qemuDomainGetStatsCpuProc(virDomainObj *vm, virTypedParamList *params) { unsigned long long cpuTime =3D 0; - unsigned long long sysTime =3D 0; unsigned long long userTime =3D 0; + unsigned long long sysTime =3D 0; =20 - if (virProcessGetStatInfo(&cpuTime, &sysTime, &userTime, + if (virProcessGetStatInfo(&cpuTime, &userTime, &sysTime, NULL, NULL, vm->pid, 0) < 0) { /* ignore error */ return 0; --=20 2.35.1