[PATCH] virhostcpu: Fix non-Linux virHostCPUGetPhysAddrSize() stub

Michal Privoznik mprivozn at redhat.com
Thu Aug 4 10:36:35 UTC 2022


The non-Linux version of virHostCPUGetPhysAddrSize() is lacking
G_GNUC_UNUSED attribute to its @size argument which triggers an
error on all non-Linux builds. And while at it, make the function
actually signal error (ENOSYS) since it does not set the
argument.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---

Pushed as build breaker fix.

 src/util/virhostcpu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index 3a02e224e8..54d0166b85 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -1672,9 +1672,10 @@ virHostCPUGetSignature(char **signature)
 }
 
 int
-virHostCPUGetPhysAddrSize(unsigned int *size)
+virHostCPUGetPhysAddrSize(unsigned int *size G_GNUC_UNUSED)
 {
-    return 0;
+    errno = ENOSYS;
+    return -1;
 }
 
 #endif /* __linux__ */
-- 
2.35.1



More information about the libvir-list mailing list