From nobody Sat May 18 12:47:39 2024 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; dmarc=fail(p=quarantine dis=quarantine) header.from=swemel.ru ARC-Seal: i=1; a=rsa-sha256; t=1693902172; cv=none; d=zohomail.com; s=zohoarc; b=XpRAuUo3uqfWe9ST2TaiREO1qAnQDFJctiVwCkHhClmprXGx+oaQ2cbyowW0HyvI9iKEDyJ4B38h5LBK2rcKX73fVCsJH/4VmKMDm3xRcm0ijwt7wDuNU8qmTHIt74y4JGSW7Jr1PVMSRae+Qx31IM5tAAN82UsZ7W+hGpmHKSA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693902172; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=sDD3EtYFOhQ+D5MmJS96/HnUvlEC1IMBUPcVVdM9GBg=; b=O6ZYDfOwCbWk6hxqXXgryTtTxSGFQwbhSZUwcjndcz1udASQaw5vgh0dabVXP/jgHp7VouA7b4gnJ+rDPflJ+Njwr1GExPAeX+Au+0vY5ivoN/jAUM482NY1sIiQeo7iJGrBSc3iD+5KPgPDelm4fqlZvHWcDx6jPvZPoP/D+fs= 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; dmarc=fail header.from= (p=quarantine dis=quarantine) 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 1693902172696305.8595575195899; Tue, 5 Sep 2023 01:22:52 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.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-58-4eLX4qg8Mx6AT8LdNOY40A-1; Tue, 05 Sep 2023 04:22:48 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6AA843802AC4; Tue, 5 Sep 2023 08:22:45 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57307140E950; Tue, 5 Sep 2023 08:22:45 +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 0B46019465A3; Tue, 5 Sep 2023 08:22:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E0B201946595 for ; Mon, 4 Sep 2023 11:54:31 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CED211182D4; Mon, 4 Sep 2023 11:54:31 +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 8F861C124A for ; Mon, 4 Sep 2023 11:54:31 +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 75B6E8ABDC2 for ; Mon, 4 Sep 2023 11:54:31 +0000 (UTC) Received: from mx.swemel.ru (mx.swemel.ru [95.143.211.150]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-D1YAHJqwMu2zmperqbcdiA-1; Mon, 04 Sep 2023 07:54:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693902171; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sDD3EtYFOhQ+D5MmJS96/HnUvlEC1IMBUPcVVdM9GBg=; b=LVHe20Ixr82stF94ak2XtRLNv9aiANj4s3qrSJu+2EDDdcKUvo8Yy+PwI8+n0Xtf1cyPji 1E9iuzS+RNQctaPOB07Rh4I63e7ceImtZ2QxTqzFp2Eq4QQdors5cqwqQiScUglXcIr+Rk Lykq4dGC0i94M3urJHA3Ty5m+7F/2UU= X-MC-Unique: 4eLX4qg8Mx6AT8LdNOY40A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: D1YAHJqwMu2zmperqbcdiA-1 From: Dmitry Frolov To: libvir-list@redhat.com Subject: [PATCH] fix virCgroupGetMemoryStat arguments order Date: Mon, 4 Sep 2023 14:44:48 +0300 Message-Id: <20230904114448.147467-1-frolov@swemel.ru> 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 3.1 on 10.11.54.5 X-Mailman-Approved-At: Tue, 05 Sep 2023 08:22:44 +0000 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: Dmitry Frolov Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: swemel.ru Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1693902175633100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Reviewing the sources, I noticed that, argumets order in virCgroupGetMemoryStat() function call does not correspond to the function declaration: -instead of *activeAnon, &meminfo->inactive_anon is passed; -instead of *inactiveAnon, &meminfo->active_anon is passed; -instead of *activeFile, &meminfo->inactive_file is passed; -instead of *inactiveFile, &meminfo->active_file is passed. Fixes: e634c7cd0d ("lxc: Use virCgroupGetMemoryStat") Signed-off-by: Dmitry Frolov Reviewed-by: Martin Kletzander --- src/lxc/lxc_cgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index 1b516bba73..bc39b16928 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -130,10 +130,10 @@ static int virLXCCgroupGetMemStat(virCgroup *cgroup, { return virCgroupGetMemoryStat(cgroup, &meminfo->cached, - &meminfo->inactive_anon, &meminfo->active_anon, - &meminfo->inactive_file, + &meminfo->inactive_anon, &meminfo->active_file, + &meminfo->inactive_file, &meminfo->unevictable); } =20 --=20 2.34.1