[libvirt] [PATCH 3/3] virhostcpu: Make only defined symbols available

Martin Kletzander posted 3 patches 8 years, 10 months ago
[libvirt] [PATCH 3/3] virhostcpu: Make only defined symbols available
Posted by Martin Kletzander 8 years, 10 months ago
That way you get the error from the compiler before the linker.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
 src/util/virhostcpu.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/util/virhostcpu.h b/src/util/virhostcpu.h
index a4ce655d6a2e..e9c22eecc9c9 100644
--- a/src/util/virhostcpu.h
+++ b/src/util/virhostcpu.h
@@ -57,10 +57,13 @@ int virHostCPUStatsAssign(virNodeCPUStatsPtr param,
                           const char *name,
                           unsigned long long value);

+# ifdef __linux__
 int virHostCPUGetSocket(unsigned int cpu, unsigned int *socket);
 int virHostCPUGetCore(unsigned int cpu, unsigned int *core);
-int virHostCPUGetOnline(unsigned int cpu, bool *online);

 virBitmapPtr virHostCPUGetSiblingsList(unsigned int cpu);
+# endif
+
+int virHostCPUGetOnline(unsigned int cpu, bool *online);

 #endif /* __VIR_HOSTCPU_H__*/
-- 
2.12.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 3/3] virhostcpu: Make only defined symbols available
Posted by Pavel Hrdina 8 years, 10 months ago
On Mon, Mar 27, 2017 at 04:21:10PM +0200, Martin Kletzander wrote:
> That way you get the error from the compiler before the linker.
> 
> Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
> ---
>  src/util/virhostcpu.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

ACK

Pavel
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Expose Linux symbols only on Linux
Posted by Martin Kletzander 8 years, 10 months ago
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
Just to make it a teeny tiny nicer, how about this one as well.  I
know the whole file needs way more refactoring and cleaning up, but we
can do that by small pieces.

 src/libvirt_linux.syms   | 3 +++
 src/libvirt_private.syms | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/libvirt_linux.syms b/src/libvirt_linux.syms
index 3d66f013062b..5fa2c790efc1 100644
--- a/src/libvirt_linux.syms
+++ b/src/libvirt_linux.syms
@@ -3,7 +3,10 @@
 #

 # util/virhostcpu.h
+virHostCPUGetCore;
 virHostCPUGetInfoPopulateLinux;
+virHostCPUGetSiblingsList;
+virHostCPUGetSocket;
 virHostCPUGetStatsLinux;

 # Let emacs know we want case-insensitive sorting
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 4c14ef59012a..605a6e6785be 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1713,7 +1713,6 @@ virHookPresent;


 # util/virhostcpu.h
-virHostCPUGetCore;
 virHostCPUGetCount;
 virHostCPUGetInfo;
 virHostCPUGetKVMMaxVCPUs;
@@ -1721,7 +1720,6 @@ virHostCPUGetMap;
 virHostCPUGetOnline;
 virHostCPUGetOnlineBitmap;
 virHostCPUGetPresentBitmap;
-virHostCPUGetSocket;
 virHostCPUGetStats;
 virHostCPUGetThreadsPerSubcore;
 virHostCPUHasBitmap;
--
2.12.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Expose Linux symbols only on Linux
Posted by Pavel Hrdina 8 years, 10 months ago
On Mon, Mar 27, 2017 at 05:17:57PM +0200, Martin Kletzander wrote:
> Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
> ---
> Just to make it a teeny tiny nicer, how about this one as well.  I
> know the whole file needs way more refactoring and cleaning up, but we
> can do that by small pieces.

ACK, this also fixes a potential issue that the virHostCPUGetSiblingsList
is not listed in any of the *.syms files.

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