From nobody Sun May 5 11:37:47 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 1642776585258324.42265060892316; Fri, 21 Jan 2022 06:49:45 -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-318-J3HYU5aPO_C06Q2UOZBVeg-1; Fri, 21 Jan 2022 09:49:42 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7700A94EEF; Fri, 21 Jan 2022 14:49:37 +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 51A807B6E2; Fri, 21 Jan 2022 14:49:37 +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 1F09F1806D1D; Fri, 21 Jan 2022 14:49:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20LEhFLb020360 for ; Fri, 21 Jan 2022 09:43:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 182E54047294; Fri, 21 Jan 2022 14:43:15 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1411F4047293 for ; Fri, 21 Jan 2022 14:43:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 EFD2D3802AC3 for ; Fri, 21 Jan 2022 14:43:14 +0000 (UTC) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-458-ifUq4fnNOI2vv4ofeELLHg-1; Fri, 21 Jan 2022 09:43:13 -0500 Received: by mail-pj1-f48.google.com with SMTP id d5so7139798pjk.5 for ; Fri, 21 Jan 2022 06:43:12 -0800 (PST) Received: from anisinha-lenovo.ba.nuagenetworks.net ([203.163.243.216]) by smtp.googlemail.com with ESMTPSA id x32sm7811335pfh.151.2022.01.21.06.43.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 06:43:11 -0800 (PST) X-MC-Unique: J3HYU5aPO_C06Q2UOZBVeg-1 X-MC-Unique: ifUq4fnNOI2vv4ofeELLHg-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=QkwgVy5d1D2gKYpy4ewshmBI4PPAD/aPDl8nmZA58xE=; b=W6Rd8RZ5/6mYoHXbi+EfkvMqZ08uYmtOpY8EKJ+dWxpW2tUxt3PIhQgrsyD5tg6sr3 Pr7kBOvaPJ5M/WRdP5rYJ+9+yc4MPCLZajsW0XDyl2sMpnEoTwkduv87uTwV+UNdP/dT hNnuop1GtcAFzSb1HGsFc72pqY0vV1cdXjgcvDmTq+mTmAtfXHc+GXOCjMdmuCP3XX3z vObSIpVAFS7UEbQcvoQcLXfwdUkQDd8cQqf7Fmy6lhEMuiA7hEZK7AYzzwqq//L75iHf 7B77Td1EQabs1iSsjBqVtvTm2eCLY4Vo/5qptmhjwg8XI5NBYhlWJRxninwLu00+rCdW CtIg== X-Gm-Message-State: AOAM530ZIw86A9MwFRvKjcv0j8I91RrmxK2qtUFRvCbE0JcVGcYqno7d uUhzarWHfDY4zZyU1OKkQzW2JTEkav4yaQ== X-Google-Smtp-Source: ABdhPJxWes1Zk5vam/XIUYVDSuLhE3ppPQDrwyTGexlBS6L42RQ0cuueMw1pQReu2Ok45TH32Q6gLQ== X-Received: by 2002:a17:90b:1b4b:: with SMTP id nv11mr1072453pjb.230.1642776191617; Fri, 21 Jan 2022 06:43:11 -0800 (PST) From: Ani Sinha To: libvir-list@redhat.com Subject: [PATCH] virProcessGetStatInfo: add a comment describing why we can not report error Date: Fri, 21 Jan 2022 20:13:05 +0530 Message-Id: <20220121144305.929938-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.84 on 10.11.54.2 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.16 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: 1642776586370100003 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. 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