]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuhotplugtest: Make the test more useful by validating used commands against QMP...
authorPeter Krempa <pkrempa@redhat.com>
Thu, 9 Mar 2023 17:07:45 +0000 (18:07 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 3 Apr 2023 07:19:07 +0000 (09:19 +0200)
qemuhotplugtest validates only that a given command is used but not the
arguments of the command. With this patch we'll validate the arguments
against the QMP schema thus we can catch possible issues with deprecated
commands.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuhotplugtest.c

index 9c8407c5ef1e863dc715293558c66632e1d8a003..63a6833cfde72bbd44a4d5decf6c057bba59aaa8 100644 (file)
@@ -57,6 +57,7 @@ struct qemuHotplugTestData {
     GHashTable *capsLatestFiles;
     GHashTable *capsCache;
     GHashTable *schemaCache;
+    GHashTable *schema;
 };
 
 static int
@@ -342,7 +343,7 @@ testQemuHotplug(const void *data)
         if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml,
                                      test->arch, test->capsLatestFiles,
                                      test->capsCache, test->schemaCache,
-                                     NULL) < 0)
+                                     &test->schema) < 0)
             goto cleanup;
     }
 
@@ -356,7 +357,7 @@ testQemuHotplug(const void *data)
 
     /* Now is the best time to feed the spoofed monitor with predefined
      * replies. */
-    if (!(test_mon = qemuMonitorTestNew(driver.xmlopt, vm, NULL, NULL)))
+    if (!(test_mon = qemuMonitorTestNew(driver.xmlopt, vm, NULL, test->schema)))
         goto cleanup;
 
     tmp = test->mon;