tests: sysinfo: Export virSysinfoSetup via the private header

virSysinfoSetup should be used only in tests so it can be moved to the
new header file rather than using an extern declaration.
This commit is contained in:
Peter Krempa 2017-03-06 15:25:07 +01:00
parent b38c6b6ad3
commit c58d95b7a0
3 changed files with 12 additions and 10 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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 */