]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2argvmock: Drop virNuma* mocks
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 7 Mar 2023 15:06:14 +0000 (16:06 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Mar 2023 11:46:36 +0000 (12:46 +0100)
Since qemuxml2argvtest is now using virnumamock, there's no need
for qemuxml2argvmock to offer reimplementation of virNuma*()
functions. Also, the comment about CLang and FreeBSD (introduced
in v4.3.0-40-g77ac204d14) is no longer true. Looks like noinline
attribute was the missing culprit.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/util/virnuma.h
tests/qemuxml2argvdata/numatune-memnode-unavailable-restrictive.x86_64-latest.err
tests/qemuxml2argvdata/numatune-memnode-unavailable-strict.x86_64-latest.err
tests/qemuxml2argvdata/numatune-static-nodeset-exceed-hostnode.err
tests/qemuxml2argvmock.c

index edd701d5c82b53650b3191cf10cb5f7c28d3b9d5..475df96e1d893c7c661de689fdf8a10ef241a373 100644 (file)
@@ -32,7 +32,7 @@ int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
                              virBitmap *nodeset);
 
 virBitmap *virNumaGetHostMemoryNodeset(void);
-bool virNumaNodesetIsAvailable(virBitmap *nodeset) G_NO_INLINE;
+bool virNumaNodesetIsAvailable(virBitmap *nodeset);
 bool virNumaIsAvailable(void) G_NO_INLINE;
 int virNumaGetMaxNode(void) G_NO_INLINE;
 bool virNumaNodeIsAvailable(int node) G_NO_INLINE;
index a826c3cdeb8c152c4ecad0fab9053059809284d1..f872dd7e9237d18058df9199bce3866c6ab48c43 100644 (file)
@@ -1 +1 @@
-internal error: Mock: no numa node set is available at bit 999
+unsupported configuration: NUMA node 999 is unavailable
index a826c3cdeb8c152c4ecad0fab9053059809284d1..f872dd7e9237d18058df9199bce3866c6ab48c43 100644 (file)
@@ -1 +1 @@
-internal error: Mock: no numa node set is available at bit 999
+unsupported configuration: NUMA node 999 is unavailable
index b6b98775ee91776f5889945cfb1e9bfd47d0cbb5..2a33ccd7911c63b02bef7aedab941066bbcdd15c 100644 (file)
@@ -1 +1 @@
-internal error: Mock: no numa node set is available at bit 8
+unsupported configuration: NUMA node 4 is unavailable
index 85bd76c315f394646b9d55221f4c5745e4b0c687..f566ec539afb38fe63bed530500de3cb69a2ab98 100644 (file)
@@ -30,7 +30,6 @@
 #include "virnetdevip.h"
 #include "virnetdevtap.h"
 #include "virnetdevopenvswitch.h"
-#include "virnuma.h"
 #include "virscsivhost.h"
 #include "virtpm.h"
 #include "virutil.h"
@@ -56,47 +55,6 @@ GDateTime *g_date_time_new_now_local(void)
     return g_date_time_new_from_unix_local(1234567890);
 }
 
-bool
-virNumaIsAvailable(void)
-{
-    return true;
-}
-
-int
-virNumaGetMaxNode(void)
-{
-    return 7;
-}
-
-/* We shouldn't need to mock virNumaNodeIsAvailable() and *definitely* not
- * virNumaNodesetIsAvailable(), but it seems to be the only way to get
- * mocking to work with Clang on FreeBSD, so keep these duplicates around
- * until we figure out a cleaner solution */
-bool
-virNumaNodeIsAvailable(int node)
-{
-    return node >= 0 && node <= virNumaGetMaxNode();
-}
-
-bool
-virNumaNodesetIsAvailable(virBitmap *nodeset)
-{
-    ssize_t bit = -1;
-
-    if (!nodeset)
-        return true;
-
-    while ((bit = virBitmapNextSetBit(nodeset, bit)) >= 0) {
-        if (virNumaNodeIsAvailable(bit))
-            continue;
-
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "Mock: no numa node set is available at bit %zd", bit);
-        return false;
-    }
-
-    return true;
-}
 
 char *
 virTPMCreateCancelPath(const char *devpath)