From nobody Tue Nov 26 06:31:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1583846687; cv=none; d=zohomail.com; s=zohoarc; b=MoerkD+BAxmc49SUPZyZS/vFRrsG1hNKy74MYpPVWrQOFfWoVvpgx1N6CuOxtzjpRcOP/34VnXjgAW9JinedVhZ9ji1Ir9P5H3Wu7itBfB1jsrybRnUiS6gcMtfZ45KxcHxb12HT1TDFqyIF6d8CLa/rHLmudx3oLKR1qFER1pY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583846687; 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=NqgLKNVvYG+nYuh90M9+IjR27yy9kTzcbMbV5slgr9U=; b=hf0JgKSF0MEvdG7MgGhP4WJYw41+Ey+5nyW1puswZfYm2H0akeMngYPg5M6jRqWcofQV3bkHX0Fmwb/uPU3qeQhJhe6BBDk8K62ipd/X3C1YpdlmI/cO3gDcwPMGvDLj68IcIxbOGiwAapQMwS8eH5OvbnzsRWG63NnAtTAyqwQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 15838466879207.52802889592931; Tue, 10 Mar 2020 06:24:47 -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-371-TvCczmFLNkWCz_4OKAvz7g-1; Tue, 10 Mar 2020 09:24:44 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 031AF800D50; Tue, 10 Mar 2020 13:24:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CA1090F5B; Tue, 10 Mar 2020 13:24:38 +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 E622586A09; Tue, 10 Mar 2020 13:24:37 +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 02ADOaVc029744 for ; Tue, 10 Mar 2020 09:24:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 732DD5D9E5; Tue, 10 Mar 2020 13:24:36 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.43.2.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED1305D9C5 for ; Tue, 10 Mar 2020 13:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583846687; 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=NqgLKNVvYG+nYuh90M9+IjR27yy9kTzcbMbV5slgr9U=; b=d/Zu653RI3pTV36/sbh6fQPRtbo4okm1AF/CtdULXh2RCfXNRvuvx6Mh3SVnCaR9JJ7Flh fW8axWoya5JjdqmLSe7i871IYYwZ4pwmMHrLCi7E0GgQ1hXbZMDWAkn2LJemMq4hBIjzz0 IILvhHXVWzvXdvVsS8zsm/LPXL7JyAo= X-MC-Unique: TvCczmFLNkWCz_4OKAvz7g-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/4] util: remove virStrerror Date: Tue, 10 Mar 2020 14:24:28 +0100 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.15 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" Now that we use g_strerror exclusively, remove this unused function. Signed-off-by: J=C3=A1n Tomko --- src/libvirt_private.syms | 1 - src/util/virerror.c | 25 ------------------------- src/util/virerror.h | 2 -- 3 files changed, 28 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 511fb88872..22f6d14ced 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1981,7 +1981,6 @@ virReportOOMErrorFull; virReportSystemErrorFull; virSetError; virSetErrorLogPriorityFunc; -virStrerror; =20 =20 # util/vireventglib.h diff --git a/src/util/virerror.c b/src/util/virerror.c index 16c384d2f9..774c36bca3 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -1307,31 +1307,6 @@ void virReportErrorHelper(int domcode, errno =3D save_errno; } =20 -/** - * virStrerror: - * @theerrno: the errno value - * @errBuf: the buffer to save the error to - * @errBufLen: the buffer length - * - * Generate an error string for the given errno - * - * Returns a pointer to the error string, possibly indicating that the - * error is unknown - */ -const char *virStrerror(int theerrno, char *errBuf, size_t errBufLen) -{ - int save_errno =3D errno; - const char *ret; - const char *str =3D g_strerror(theerrno); - size_t len =3D strlen(str); - - memcpy(errBuf, str, MIN(len, errBufLen)); - errBuf[errBufLen-1] =3D '\0'; - ret =3D errBuf; - errno =3D save_errno; - return ret; -} - /** * virReportSystemErrorFull: * @domcode: the virErrorDomain indicating where it's coming from diff --git a/src/util/virerror.h b/src/util/virerror.h index 2e27655b72..9d3e40d65a 100644 --- a/src/util/virerror.h +++ b/src/util/virerror.h @@ -192,8 +192,6 @@ void virReportOOMErrorFull(int domcode, int virSetError(virErrorPtr newerr); virErrorPtr virErrorCopyNew(virErrorPtr err); void virDispatchError(virConnectPtr conn); -/* DEPRECATED: use g_strerror() directly */ -const char *virStrerror(int theerrno, char *errBuf, size_t errBufLen); =20 typedef int (*virErrorLogPriorityFunc)(virErrorPtr, int); void virSetErrorLogPriorityFunc(virErrorLogPriorityFunc func); --=20 2.24.1