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 <imamm...@redhat.com>
---
  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