From nobody Sun Feb 8 17:22:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1618817064; cv=none; d=zohomail.com; s=zohoarc; b=OBs6QdIh5AiXlu34r0DBM7GdwskLslgPH5p4eo/+Xa9IX/xA1YptOC8u1l2oMsH5DSP0iEMrIdnTPwzQAzhx/bxl3VcZHzhC3UFqxfUxAs1BclvfAOcisW8jBymvRzcmMp/sJkdWmPJ8AkJ4co9g1hTxONS4fVNBCJtGBdfPupM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618817064; h=Content-Type:Content-Transfer-Encoding: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=HWJ5jic5C7V62XO2nh4zl3rHKA09StHy0eMV144YNeE=; b=LYjAE/wozYMGgvvPGhaF0Ch02JbtTfzudFp4bz4JsyQf+t2FSIib3JxZz7J55s2vWWyLQSBLowTQuTooJcaPZIT0Yyq6B9Wt+0fVP8KalOORi2h15M+y6bxFJJaIzPQT0Q6c4ZPBImy9i1rY2DM6whq91l7sJ1+uqJ2J1SLxvOA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1618817064618664.9750539892376; Mon, 19 Apr 2021 00:24:24 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-aTsTytD9PGCcXfTzsZznhg-1; Mon, 19 Apr 2021 03:24:20 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 88B7B6D269; Mon, 19 Apr 2021 07:24:14 +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 6499D60C04; Mon, 19 Apr 2021 07:24:14 +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 2DCC81806D1A; Mon, 19 Apr 2021 07:24:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13J7KQPT016921 for ; Mon, 19 Apr 2021 03:20:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 48C075D9CD; Mon, 19 Apr 2021 07:20:26 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id B841A5D9F0 for ; Mon, 19 Apr 2021 07:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618817063; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HWJ5jic5C7V62XO2nh4zl3rHKA09StHy0eMV144YNeE=; b=AdMpPLD9LEpdNAckoH0QddB7z1FcvxgTP2ebZktHkchj4IArTeQS6d7xbCD+OMAcp1Pq18 bYynR3LoUxzNXmn6iuPOZwNwMrxKOcKQ+peZ+KHFK5HcscLYs/P0oF0ZfFWTKUqxmw5IOU dFTliSySm6Vgl5p/Q/T/NZjTDDzp8WQ= X-MC-Unique: aTsTytD9PGCcXfTzsZznhg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/3] vircgroupbackend: Extend error messages in VIR_CGROUP_BACKEND_CALL() Date: Mon, 19 Apr 2021 09:20:17 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com 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.12 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-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The VIR_CGROUP_BACKEND_CALL() macro gets a backend for controller and calls corresponding callback in it. If either is NULL then an error message is printed out. However, the error message contains only the intended callback func and not controller or backend found. Signed-off-by: Michal Privoznik --- src/util/vircgroupbackend.c | 1 - src/util/vircgroupbackend.h | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/util/vircgroupbackend.c b/src/util/vircgroupbackend.c index 53184cd060..6d6f82cbb1 100644 --- a/src/util/vircgroupbackend.c +++ b/src/util/vircgroupbackend.c @@ -29,7 +29,6 @@ =20 #define VIR_FROM_THIS VIR_FROM_CGROUP =20 -VIR_ENUM_DECL(virCgroupBackend); VIR_ENUM_IMPL(virCgroupBackend, VIR_CGROUP_BACKEND_TYPE_LAST, "cgroup V2", diff --git a/src/util/vircgroupbackend.h b/src/util/vircgroupbackend.h index c7f5708b86..c4d56896b0 100644 --- a/src/util/vircgroupbackend.h +++ b/src/util/vircgroupbackend.h @@ -58,6 +58,8 @@ typedef enum { VIR_CGROUP_BACKEND_TYPE_LAST, } virCgroupBackendType; =20 +VIR_ENUM_DECL(virCgroupBackend); + typedef bool (*virCgroupAvailableCB)(void); =20 @@ -464,12 +466,14 @@ virCgroupBackendForController(virCgroup *group, virCgroupBackend *backend =3D virCgroupBackendForController(group,= controller); \ if (!backend) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ - _("failed to get cgroup backend for '%s'"), #fu= nc); \ + _("failed to get cgroup backend for '%s' contro= ller '%u'"), \ + #func, controller); \ return ret; \ } \ if (!backend->func) { \ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, \ - _("operation '%s' not supported"), #func); \ + _("operation '%s' not supported for backend '%s= '"), \ + #func, virCgroupBackendTypeToString(backend->ty= pe)); \ return ret; \ } \ return backend->func(group, ##__VA_ARGS__); \ --=20 2.26.3