[PATCH v2 04/15] qemuxml2argvtest: Use virnuma mock

Michal Privoznik mprivozn at redhat.com
Tue Mar 14 16:52:18 UTC 2023


While no part of cmd line building process currently depends on a
host NUMA configuration, this will change soon. Use freshly
changed virnumamock from qemuxml2argvtest and make the mock read
NUMA data from vircaps2xmldata which seems to have the most rich
NUMA configuration.

This also means, we have to start building virnumamock
unconditionally. But this is not a problem, since nothing inside
of the mock relies on Linux specificity. The whole mock is merely
just reading files and parsing them.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 tests/meson.build        | 2 +-
 tests/qemuxml2argvtest.c | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/meson.build b/tests/meson.build
index 15b049c6ac..0fd3bc62cf 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -84,6 +84,7 @@ mock_libs = [
   { 'name': 'virnetdaemonmock' },
   { 'name': 'virnetdevmock' },
   { 'name': 'virnetserverclientmock' },
+  { 'name': 'virnumamock' },
   { 'name': 'virpcimock' },
   { 'name': 'virportallocatormock' },
   { 'name': 'virprocessmock' },
@@ -94,7 +95,6 @@ if host_machine.system() == 'linux'
   mock_libs += [
     { 'name': 'virfilemock' },
     { 'name': 'virnetdevbandwidthmock' },
-    { 'name': 'virnumamock' },
     { 'name': 'virtestmock' },
     { 'name': 'virusbmock' },
   ]
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index c879fa90e0..efecb7c89d 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -830,6 +830,8 @@ mymain(void)
     linuxCaps = driver.caps;
     macOSCaps = testQemuCapsInitMacOS();
 
+    virFileWrapperAddPrefix("/sys/devices/system",
+                            abs_srcdir "/vircaps2xmldata/linux-basic/system");
     virFileWrapperAddPrefix(SYSCONFDIR "/qemu/firmware",
                             abs_srcdir "/qemufirmwaredata/etc/qemu/firmware");
     virFileWrapperAddPrefix(PREFIX "/share/qemu/firmware",
@@ -2911,7 +2913,8 @@ VIR_TEST_MAIN_PRELOAD(mymain,
                       VIR_TEST_MOCK("domaincaps"),
                       VIR_TEST_MOCK("virrandom"),
                       VIR_TEST_MOCK("qemucpu"),
-                      VIR_TEST_MOCK("virpci"))
+                      VIR_TEST_MOCK("virpci"),
+                      VIR_TEST_MOCK("virnuma"))
 
 #else
 
-- 
2.39.2



More information about the libvir-list mailing list