[PATCH 12/15] qemumonitorjsontest: Allow use of deprecated 'query-cpus'

Peter Krempa posted 15 patches 5 years, 9 months ago
[PATCH 12/15] qemumonitorjsontest: Allow use of deprecated 'query-cpus'
Posted by Peter Krempa 5 years, 9 months ago
The command was replaced with 'query-cpus-fast' which is always used
when detected by the capabilities so we can allow our test usage of
the deprecated command even if it will be removed from the schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 tests/qemumonitorjsontest.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 7e0ab4609c..eaaabe9a47 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1440,6 +1440,8 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque)
     if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
         return -1;

+    qemuMonitorTestSkipDeprecatedValidation(test, true);
+
     if (qemuMonitorTestAddItem(test, "query-cpus",
                                "{"
                                "    \"return\": ["
@@ -2696,10 +2698,12 @@ testQemuMonitorCPUInfo(const void *opaque)
                                queryHotpluggableStr) < 0)
         goto cleanup;

-    if (data->fast)
+    if (data->fast) {
         queryCpusFunction = "query-cpus-fast";
-    else
+    } else {
         queryCpusFunction = "query-cpus";
+        qemuMonitorTestSkipDeprecatedValidation(test, true);
+    }

     if (qemuMonitorTestAddItem(test, queryCpusFunction, queryCpusStr) < 0)
         goto cleanup;
-- 
2.26.2

Re: [PATCH 12/15] qemumonitorjsontest: Allow use of deprecated 'query-cpus'
Posted by Ján Tomko 5 years, 8 months ago
On a Wednesday in 2020, Peter Krempa wrote:
>The command was replaced with 'query-cpus-fast' which is always used
>when detected by the capabilities so we can allow our test usage of
>the deprecated command even if it will be removed from the schema.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> tests/qemumonitorjsontest.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano