]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: error: Export virErrorMsg for use in testsuite
authorPeter Krempa <pkrempa@redhat.com>
Mon, 12 Nov 2018 14:33:02 +0000 (15:33 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 14 Dec 2018 12:54:50 +0000 (13:54 +0100)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/libvirt_private.syms
src/util/Makefile.inc.am
src/util/virerror.c
src/util/virerrorpriv.h [new file with mode: 0644]

index fd63c9ca616912764a9f33e5e200f9b7bc9ce693..6184030d590348d1169a15807e147aeb80a564a0 100644 (file)
@@ -1752,6 +1752,7 @@ ebtablesRemoveForwardAllowIn;
 virDispatchError;
 virErrorCopyNew;
 virErrorInitialize;
+virErrorMsg;
 virErrorPreserveLast;
 virErrorRestore;
 virErrorSetErrnoFromLastError;
index cffbb357bc480c6fed270964dc4fde515724d5c4..4295babac3ab3e325dfcc02c58c4543d8d5bcc22 100644 (file)
@@ -50,6 +50,7 @@ UTIL_SOURCES = \
        util/virendian.h \
        util/virerror.c \
        util/virerror.h \
+       util/virerrorpriv.h \
        util/virevent.c \
        util/virevent.h \
        util/vireventpoll.c \
index 0dc95810ca5fb9e98f6fbc9dd2dd8fd412e671d9..db1bfcfbd8a2c754af680ec58ef359b1afbedb36 100644 (file)
 #include "virutil.h"
 #include "virstring.h"
 
+#define LIBVIRT_VIRERRORPRIV_H_ALLOW
+#include "virerrorpriv.h"
+#undef LIBVIRT_VIRERRORPRIV_H_ALLOW
+
 VIR_LOG_INIT("util.error");
 
 virThreadLocal virLastErr;
@@ -908,7 +912,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 = NULL;
diff --git a/src/util/virerrorpriv.h b/src/util/virerrorpriv.h
new file mode 100644 (file)
index 0000000..8e482f2
--- /dev/null
@@ -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
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LIBVIRT_VIRERRORPRIV_H_ALLOW
+# error "virerrorpriv.h may only be included by virerror.c or its test suite"
+#endif /* LIBVIRT_VIRERRORPRIV_H_ALLOW */
+
+#ifndef LIBVIRT_VIRERRORPRIV_H
+# define LIBVIRT_VIRERRORPRIV_H
+
+const char *
+virErrorMsg(virErrorNumber error,
+            const char *info);
+
+#endif /* LIBVIRT_VIRERRORPRIV_H */