[PATCH 12/24] domaincapstest: Add testing infrastructure for the '+hvf' variant

Martin Kletzander mkletzan at redhat.com
Tue Mar 21 15:12:59 UTC 2023


On Thu, Mar 16, 2023 at 05:11:41PM +0100, Peter Krempa wrote:
>Allow testing of capabilities of OSX systems with the hvf accelerator.
>
>'domaincapstest' requires special handling as we need to set
>VIR_DOMAIN_VIRT_HVF virt type in such case.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> tests/domaincapstest.c                | 74 +++++++++++++++++++--------
> tests/qemucapabilitiesdata/README.rst |  6 ++-
> 2 files changed, 57 insertions(+), 23 deletions(-)
>
>diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
>index a34eb82015..21a68e03d2 100644
>--- a/tests/domaincapstest.c
>+++ b/tests/domaincapstest.c
>@@ -275,6 +275,10 @@ doTestQemuInternal(const char *version,
>         typestr = "";
>         break;
>
>+    case VIR_DOMAIN_VIRT_HVF:
>+        typestr = "-hvf";
>+        break;
>+
>     default:
>         abort();
>         break;
>@@ -317,43 +321,69 @@ doTestQemu(const char *inputDir G_GNUC_UNUSED,
>            const char *suffix G_GNUC_UNUSED,
>            void *opaque)
> {
>+    bool hvf = false;
>     int ret = 0;
>
>     /* currently variant tests are not handled here */
>-    if (STRNEQ(variant, ""))
>-        return 0;
>+    if (STRNEQ(variant, "")) {
>+
>+        if (STREQ(variant, "+hvf"))
>+            hvf = true;
>+        else
>+            return 0;
>+    }
>

No need for nesting or the extra empty line :P
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20230321/97a64993/attachment.sig>


More information about the libvir-list mailing list