From nobody Tue May 7 20:44:15 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; 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 1642777578266217.88432128650084; Fri, 21 Jan 2022 07:06:18 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-78-LfYCnbGkNxa42AZXU_u6vg-1; Fri, 21 Jan 2022 10:06:09 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9F6E41091DA9; Fri, 21 Jan 2022 15:06:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A2AD7E647; Fri, 21 Jan 2022 15:06:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4558F1809CB8; Fri, 21 Jan 2022 15:06:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20LF162b022408 for ; Fri, 21 Jan 2022 10:01:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 55B171121319; Fri, 21 Jan 2022 15:01:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E59B1120ABB for ; Fri, 21 Jan 2022 15:01:03 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (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 417381C0999A for ; Fri, 21 Jan 2022 15:01:03 +0000 (UTC) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-207-HVZ_I9uiOj6p8En-wDcQ1w-1; Fri, 21 Jan 2022 10:01:01 -0500 Received: by mail-pl1-f178.google.com with SMTP id e8so8612055plh.8 for ; Fri, 21 Jan 2022 07:00:59 -0800 (PST) Received: from anisinha-lenovo.ba.nuagenetworks.net ([203.163.243.216]) by smtp.googlemail.com with ESMTPSA id z1sm6896674pfh.201.2022.01.21.07.00.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 07:00:57 -0800 (PST) X-MC-Unique: LfYCnbGkNxa42AZXU_u6vg-1 X-MC-Unique: HVZ_I9uiOj6p8En-wDcQ1w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=caub4k7wLBU8h/npUaTjLyu8/ESm0AlWdX7mxvWxUT0=; b=tc6Zq/TVyvvlNiSjyi6zArwYROA2tJJ996USB5+VlXc7vkUoboJf0NzPAoYZbfUstS NLcdgdiXNf3L/7J/aQHaElb23q3T/yICqp4zS29uNtplOH/O2zz8vdxgASK/PJCc5gKu t0W33AHPy9seh3u71nFdHRYAs7T9aii6WpzmE/ukuDBntgtB1s0QsaLBUIa+2ABSgHF2 DXlH0cr0KzZA96Rrgzp4UjqdFrXz8SR7KriSQSRIX62Hj1TdRqGS5YmXKEcAyTQrAoZ7 2eHwUzDTAzBpTzsy0hpao7YyR3tRCRO+qnxlLYgwBVRuaWyU2jptgxuPiDxkEe732Vvs srrg== X-Gm-Message-State: AOAM533nc5UbcwsuGYxTCA/G/5iJHni0X/x4bAP+9uNYAahaHUWsBBXq 1STNdXYPXvB3rMmZGKFfnckS2nKxzNiIBw== X-Google-Smtp-Source: ABdhPJxrYdcGyJQmDvmeAHhpm86az22eQL6CWsMMCe6w9/a9Yy3Gnb+Q+wMP26BN4SdKIamj0/aRwQ== X-Received: by 2002:a17:903:234a:b0:14a:537b:db21 with SMTP id c10-20020a170903234a00b0014a537bdb21mr4002530plh.170.1642777258467; Fri, 21 Jan 2022 07:00:58 -0800 (PST) From: Ani Sinha To: libvir-list@redhat.com Subject: [PATCH v2] virProcessGetStatInfo: add a comment describing why we can not report error Date: Fri, 21 Jan 2022 20:30:47 +0530 Message-Id: <20220121150047.930628-1-ani@anisinha.ca> 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.3 X-loop: libvir-list@redhat.com Cc: Ani Sinha X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1642777579208100001 Content-Type: text/plain; charset="utf-8" virProcessGetStatInfo() currently is unable to report error conditions beca= use that breaks libvirt's public best effort APIs. We add a comment in the func= tion to indicate this. Adding comment here prevents others from going down the p= ath of reporting error conditions in this functions in the future. It also remi= nds us that at some point in the future we need to fix the code so that this limitations no longer exists. Please also see commit 105dace22cc7 ("Revert "report error when virProcessGetStatInfo() is unable = to parse data"") Signed-off-by: Ani Sinha --- src/util/virprocess.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index b559a4257e..9422829b8b 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -1784,6 +1784,12 @@ virProcessGetStatInfo(unsigned long long *cpuTime, virStrToLong_ullp(proc_stat[VIR_PROCESS_STAT_STIME], NULL, 10, &sy= stime) < 0 || virStrToLong_l(proc_stat[VIR_PROCESS_STAT_RSS], NULL, 10, &rss) < = 0 || virStrToLong_i(proc_stat[VIR_PROCESS_STAT_PROCESSOR], NULL, 10, &c= pu) < 0) { + /* This function can not report error at present. Reporting error = here + * causes some of libvirt's best effort public APIs to fail. This + * resuts in external API behavior change. Until we can fix this in + * a way so that public API behavior remains unchanged, we can only + * write a warning log here. + */ VIR_WARN("cannot parse process status data"); } =20 --=20 2.25.1