[PATCH 15/24] tests: Mock virQEMUCapsProbeHVF directly in qemucapabilitiestest

Peter Krempa pkrempa at redhat.com
Thu Mar 16 16:11:44 UTC 2023


It needs to be mocked only for 'qemucapabilitiestest'. Additionally
moving it here will allow to control the return value based on the test
data which will be required for testing dumps from HVF accelerated qemu.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 tests/domaincapsmock.c       | 6 ------
 tests/qemucapabilitiestest.c | 7 +++++++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c
index 8f27eeb3a1..d382d06e27 100644
--- a/tests/domaincapsmock.c
+++ b/tests/domaincapsmock.c
@@ -51,12 +51,6 @@ virQEMUCapsGetKVMSupportsSecureGuest(virQEMUCaps *qemuCaps)

     return real_virQEMUCapsGetKVMSupportsSecureGuest(qemuCaps);
 }
-
-bool
-virQEMUCapsProbeHVF(virQEMUCaps *qemuCaps G_GNUC_UNUSED)
-{
-    return false;
-}
 #endif

 int
diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
index 7575f9fd44..dcc965130e 100644
--- a/tests/qemucapabilitiestest.c
+++ b/tests/qemucapabilitiestest.c
@@ -45,6 +45,13 @@ struct _testQemuData {
 };


+bool
+virQEMUCapsProbeHVF(virQEMUCaps *qemuCaps G_GNUC_UNUSED)
+{
+    return false;
+}
+
+
 static int
 testQemuDataInit(testQemuData *data)
 {
-- 
2.39.2



More information about the libvir-list mailing list