]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: qemuxml2argv: report error on ARG_* collisions
authorCole Robinson <crobinso@redhat.com>
Thu, 21 Mar 2019 19:16:21 +0000 (15:16 -0400)
committerCole Robinson <crobinso@redhat.com>
Fri, 22 Mar 2019 15:51:47 +0000 (11:51 -0400)
* ARG_CAPS_ARCH must be specified with ARG_CAPS_VER
* ARG_QEMU_CAPS shouldn't be specified with ARG_CAPS_*

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
tests/qemuxml2argvtest.c

index 3db0da241d25f44e2624fb3666334a19f75334f3..20fef8f67200d8995b1475fb7c9960ef9c7c44cb 100644 (file)
@@ -688,6 +688,18 @@ testInfoSetArgs(struct testInfo *info,
         }
     }
 
+    if (!!capsarch ^ !!capsver) {
+        fprintf(stderr, "ARG_CAPS_ARCH and ARG_CAPS_VER "
+                        "must be specified together.\n");
+        goto cleanup;
+    }
+
+    if (qemuCaps && (capsarch || capsver)) {
+        fprintf(stderr, "ARG_QEMU_CAPS can not be combined with ARG_CAPS_ARCH "
+                        "or ARG_CAPS_VER\n");
+        goto cleanup;
+    }
+
     if (!qemuCaps && capsarch && capsver) {
         bool stripmachinealiases = false;