From b07c387ca9c8b40005a23ec1ce5f228fd513af89 Mon Sep 17 00:00:00 2001 From: Andrew Fasano Date: Wed, 6 Dec 2023 09:42:48 -0500 Subject: [PATCH] Add panda_callbacks_qmp stub in qtest so qmp tests can run without panda --- qapi/qmp-dispatch.c | 3 +++ stubs/qtest.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 5bc2b2d36d4..8311ff99bce 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -19,8 +19,11 @@ #include "qapi/qmp/qjson.h" #include "qapi-types.h" #include "qapi/qmp/qerror.h" + //#include "panda/callbacks/cb-support.h" extern bool panda_callbacks_qmp(char *command, char* args, char **result); +// And we have a stub in stubs/qtest.c that always returns false if we build +// without panda for tests static QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp) { diff --git a/stubs/qtest.c b/stubs/qtest.c index 891eb954fbe..f68f66e9395 100644 --- a/stubs/qtest.c +++ b/stubs/qtest.c @@ -18,3 +18,9 @@ bool qtest_driver(void) { return false; } + +/* Needed for qmp-dispatch tests to pass when we don't have panda */ +bool panda_callbacks_qmp(char *command, char* args, char **result); +bool panda_callbacks_qmp(char *command, char* args, char **result) { + return false; +}