From nobody Sun Feb 8 21:06:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1544028493132576.4962376036749; Wed, 5 Dec 2018 08:48:13 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1730308FBA4; Wed, 5 Dec 2018 16:48:10 +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 8083F5DA9B; Wed, 5 Dec 2018 16:48:10 +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 37E36181B9E7; Wed, 5 Dec 2018 16:48:10 +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 wB5Gm10Z028436 for ; Wed, 5 Dec 2018 11:48:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2A77B18BB8; Wed, 5 Dec 2018 16:48:01 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B2DF5D96F; Wed, 5 Dec 2018 16:48:00 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 5 Dec 2018 17:47:45 +0100 Message-Id: <9764301a70c249c6b674cb1ba9cb4ef99f660f04.1544028281.git.pkrempa@redhat.com> 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 Cc: Peter Krempa Subject: [libvirt] [PATCH 04/10] util: error: Export virErrorMsg for use in testsuite 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 05 Dec 2018 16:48:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Erik Skultety --- src/Makefile.am | 1 + src/libvirt_private.syms | 1 + src/util/Makefile.inc.am | 1 + src/util/virerror.c | 5 ++++- src/util/virerrorpriv.h | 28 ++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/util/virerrorpriv.h diff --git a/src/Makefile.am b/src/Makefile.am index 33ff280d78..0bb3ff8fc8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -951,6 +951,7 @@ libvirt_nss_la_SOURCES =3D \ util/vircommand.h \ util/virerror.c \ util/virerror.h \ + util/virerrorpriv.h \ util/virfile.c \ util/virfile.h \ util/virhash.c \ diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index fd63c9ca61..6184030d59 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1752,6 +1752,7 @@ ebtablesRemoveForwardAllowIn; virDispatchError; virErrorCopyNew; virErrorInitialize; +virErrorMsg; virErrorPreserveLast; virErrorRestore; virErrorSetErrnoFromLastError; diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am index cffbb357bc..4295babac3 100644 --- a/src/util/Makefile.inc.am +++ b/src/util/Makefile.inc.am @@ -50,6 +50,7 @@ UTIL_SOURCES =3D \ util/virendian.h \ util/virerror.c \ util/virerror.h \ + util/virerrorpriv.h \ util/virevent.c \ util/virevent.h \ util/vireventpoll.c \ diff --git a/src/util/virerror.c b/src/util/virerror.c index 64be00dc75..be23712a60 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -31,6 +31,9 @@ #include "virutil.h" #include "virstring.h" +#define __VIR_ERROR_ALLOW_INCLUDE_PRIV_H__ +#include "virerrorpriv.h" + VIR_LOG_INIT("util.error"); virThreadLocal virLastErr; @@ -910,7 +913,7 @@ void virRaiseErrorObject(const char *filename, * * Returns the constant string associated to @error */ -static const char * +const char * virErrorMsg(virErrorNumber error, const char *info) { const char *errmsg =3D NULL; diff --git a/src/util/virerrorpriv.h b/src/util/virerrorpriv.h new file mode 100644 index 0000000000..bc214393e6 --- /dev/null +++ b/src/util/virerrorpriv.h @@ -0,0 +1,28 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#ifndef __VIR_ERROR_ALLOW_INCLUDE_PRIV_H__ +# error "virerrorpriv.h may only be included by virerror.c or its test sui= te" +#endif + +#ifndef __VIR_ERROR_PRIV_H__ +# define __VIR_ERROR_PRIV_H__ + +const char * +virErrorMsg(virErrorNumber error, + const char *info); + +#endif /* __VIR_ERROR_PRIV_H__ */ --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list