qemuxml2argvmock: Drop virNuma* mocks

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>
This commit is contained in:
Michal Privoznik 2023-03-07 16:06:14 +01:00
parent c4c90063a5
commit 95ae91fdd4
5 changed files with 4 additions and 46 deletions

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

View File

@ -1 +1 @@
internal error: Mock: no numa node set is available at bit 999
unsupported configuration: NUMA node 999 is unavailable

View File

@ -1 +1 @@
internal error: Mock: no numa node set is available at bit 999
unsupported configuration: NUMA node 999 is unavailable

View File

@ -1 +1 @@
internal error: Mock: no numa node set is available at bit 8
unsupported configuration: NUMA node 4 is unavailable

View 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)