[PATCH 2/4] tests: sysinfo: Export virSysinfoSetup via the private header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



virSysinfoSetup should be used only in tests so it can be moved to the
new header file rather than using an extern declaration.
---
 src/util/virsysinfo.c     | 9 ++++-----
 src/util/virsysinfopriv.h | 5 +++++
 tests/sysinfotest.c       | 8 +++-----
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index bdd430470..7b54bda12 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -55,12 +55,11 @@ static const char *sysinfoCpuinfo = "/proc/cpuinfo";
 #define CPUINFO sysinfoCpuinfo
 #define CPUINFO_FILE_LEN (1024*1024)	/* 1MB limit for /proc/cpuinfo file */

-/* only to be used test programs, therefore not in sysinfo.h */
-extern void virSysinfoSetup(const char *dmidecode, const char *sysinfo,
-                            const char *cpuinfo);

-void virSysinfoSetup(const char *dmidecode, const char *sysinfo,
-                     const char *cpuinfo)
+void
+virSysinfoSetup(const char *dmidecode,
+                const char *sysinfo,
+                const char *cpuinfo)
 {
     sysinfoDmidecode = dmidecode;
     sysinfoSysinfo = sysinfo;
diff --git a/src/util/virsysinfopriv.h b/src/util/virsysinfopriv.h
index 915236479..a50b280f6 100644
--- a/src/util/virsysinfopriv.h
+++ b/src/util/virsysinfopriv.h
@@ -24,6 +24,11 @@
 #ifndef __VIR_SYSINFO_PRIV_H__
 # define __VIR_SYSINFO_PRIV_H__

+void
+virSysinfoSetup(const char *dmidecode,
+                const char *sysinfo,
+                const char *cpuinfo);
+
 virSysinfoDefPtr
 virSysinfoReadPPC(void);

diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c
index 457c3415e..f81a0466c 100644
--- a/tests/sysinfotest.c
+++ b/tests/sysinfotest.c
@@ -37,6 +37,9 @@
 #include "virfile.h"
 #include "virstring.h"

+#define __VIR_SYSINFO_PRIV_H_ALLOW__
+#include "virsysinfopriv.h"
+
 #define VIR_FROM_THIS VIR_FROM_NONE

 #if defined (__linux__)
@@ -46,11 +49,6 @@
      defined(__i386__) || defined(__x86_64__) || defined(__amd64__) || \
      defined(__arm__) || defined(__aarch64__)

-/* from sysinfo.c */
-void virSysinfoSetup(const char *decoder,
-                     const char *sysinfo,
-                     const char *cpuinfo);
-
 struct testSysinfoData {
     char *decoder; /* name of dmi decoder binary/script */
     char *sysinfo; /* name of /proc/sysinfo substitute file */
-- 
2.11.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux