From: Ján Tomko Date: Wed, 22 Jan 2014 11:56:06 +0000 (+0100) Subject: Move test-local declarations to nodeinfopriv.h X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b3b44c572cca050c65aec2538ca00aebe8ba5ae7;p=libvirt.git Move test-local declarations to nodeinfopriv.h linuxNodeInfoCPUPopulate is only used in the nodeinfo.c file and in the test suite. --- diff --git a/src/Makefile.am b/src/Makefile.am index 7844efa60a..abe0a51293 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -168,7 +168,7 @@ util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ EXTRA_DIST += util/virthreadpthread.c util/virthreadwin32.c # Internal generic driver infrastructure -NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c +NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c nodeinfopriv.h DATATYPES_SOURCES = datatypes.h datatypes.c DRIVER_SOURCES = \ driver.c driver.h \ diff --git a/src/nodeinfo.c b/src/nodeinfo.c index cf6d29b989..af049cb414 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -40,7 +40,7 @@ #include "c-ctype.h" #include "viralloc.h" -#include "nodeinfo.h" +#include "nodeinfopriv.h" #include "physmem.h" #include "virlog.h" #include "virerror.h" @@ -189,11 +189,6 @@ freebsdNodeGetMemoryStats(virNodeMemoryStatsPtr params, # define LINUX_NB_MEMORY_STATS_ALL 4 # define LINUX_NB_MEMORY_STATS_CELL 2 -/* NB, this is not static as we need to call it from the testsuite */ -int linuxNodeInfoCPUPopulate(FILE *cpuinfo, - const char *sysfs_dir, - virNodeInfoPtr nodeinfo); - /* Return the positive decimal contents of the given * DIR/cpu%u/FILE, or -1 on error. If DEFAULT_VALUE is non-negative * and the file could not be found, return that instead of an error; diff --git a/src/nodeinfopriv.h b/src/nodeinfopriv.h new file mode 100644 index 0000000000..9aa32627fb --- /dev/null +++ b/src/nodeinfopriv.h @@ -0,0 +1,33 @@ +/* + * nodeinfopriv.h: internal APIs for testing nodeinfo code + * + * Copyright (C) 2014 Red Hat, Inc. + * + * 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 __NODEINFO_PRIV_H__ +# define __NODEINFO_PRIV_H__ + +# include "nodeinfo.h" + +# ifdef __linux__ +int linuxNodeInfoCPUPopulate(FILE *cpuinfo, + const char *sysfs_dir, + virNodeInfoPtr nodeinfo); +# endif + +#endif /* __NODEINFO_PRIV_H__ */ diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index 74f6d4d2fb..a6247ce7d7 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -7,7 +7,7 @@ #include "testutils.h" #include "internal.h" -#include "nodeinfo.h" +#include "nodeinfopriv.h" #include "virfile.h" #include "virstring.h" @@ -27,10 +27,6 @@ main(void) #else -extern int linuxNodeInfoCPUPopulate(FILE *cpuinfo, - char *sysfs_dir, - virNodeInfoPtr nodeinfo); - static int linuxTestCompareFiles(const char *cpuinfofile, char *sysfs_dir,