On Fri, May 04, 2018 at 10:37:49AM +0200, 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> > --- > v6: > * replace 'cont' with 'exit-preconfig' command > v5: > * s/qobject_to_qdict(/qobject_to(QDict,/ > * s/-preconfig/--preconfig/ > v4: > * drop duplicate is_err() and reuse qmp_rsp_is_err() wich is moved > to generic file libqtest.c. (Eric Blake <ebl...@redhat.com>) > > FIXUP! tests: functional tests for QMP command set-numa-node > --- > tests/libqtest.h | 9 ++++++++ > tests/libqtest.c | 7 +++++++ > tests/numa-test.c | 61 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/qmp-test.c | 7 ------- > 4 files changed, 77 insertions(+), 7 deletions(-) > > diff --git a/tests/libqtest.h b/tests/libqtest.h > index cbe8df4..ac52872 100644 > --- a/tests/libqtest.h > +++ b/tests/libqtest.h > @@ -972,4 +972,13 @@ void qtest_qmp_device_add(const char *driver, const char > *id, const char *fmt, > */ > void qtest_qmp_device_del(const char *id); > > +/** > + * qmp_rsp_is_err: > + * @rsp: QMP response to check for error > + * > + * Test @rsp for error and discard @rsp. > + * Returns 'true' if there is error in @rsp and 'false' otherwise. > + */ > +bool qmp_rsp_is_err(QDict *rsp); > + > #endif > diff --git a/tests/libqtest.c b/tests/libqtest.c > index 6f33a37..33426d5 100644 > --- a/tests/libqtest.c > +++ b/tests/libqtest.c > @@ -1098,3 +1098,10 @@ void qtest_qmp_device_del(const char *id) > QDECREF(response1); > QDECREF(response2); > } > + > +bool qmp_rsp_is_err(QDict *rsp) > +{ > + QDict *error = qdict_get_qdict(rsp, "error"); > + QDECREF(rsp);
Oops: tests/libqtest.c: In function ‘qmp_rsp_is_err’: tests/libqtest.c:1105:5: error: implicit declaration of function ‘QDECREF’ [-Werror=implicit-function-declaration] QDECREF(rsp); ^ tests/libqtest.c:1105:5: error: nested extern declaration of ‘QDECREF’ [-Werror=nested-externs] I've fixed this on numa-next, replaced QDECREF with object_unref. -- Eduardo