qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 9/9] tests: functional tests for QMP command


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 9/9] tests: functional tests for QMP command set-numa-node
Date: Tue, 27 Feb 2018 16:19:16 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 02/16/2018 06:37 AM, Igor Mammedov wrote:
  * start QEMU with 2 unmapped cpus,
  * while in preconfig state
     * add 2 numa nodes
     * assign cpus to them
  * exit preconfig and in running state check that cpus
    are mapped correctly.

Signed-off-by: Igor Mammedov <address@hidden>
---
  tests/numa-test.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 71 insertions(+)

diff --git a/tests/numa-test.c b/tests/numa-test.c
index 68aca9c..11c2842 100644
--- a/tests/numa-test.c
+++ b/tests/numa-test.c
@@ -260,6 +260,76 @@ static void aarch64_numa_cpu(const void *data)
      g_free(cli);
  }
+static bool is_err(QDict *response)
+{
+    const char *desc = NULL;
+    QDict *error = qdict_get_qdict(response, "error");
+    if (error) {
+        desc = qdict_get_try_str(error, "desc");
+    }
+    QDECREF(response);
+    return !!desc;

Why are we duplicating this helper in more than one .c file? If it is a common task, it should be in a common file for code reuse. And as before, why are you returning false if the reply is an error but merely lacked 'desc'?

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]