Eric Blake <ebl...@redhat.com> writes: > On 07/27/2018 10:13 AM, Markus Armbruster wrote: >> Leaving interpolation into JSON to qmp() is more robust than building >> QMP input manually, as explained in the recent commit "tests: Clean up >> string interpolation into QMP input (simple cases)". >> >> migrate() interpolates members into a JSON object. Change it to take >> its extra QMP arguments as arguments for qdict_from_jsonf_nofail() >> instead of a string containing JSON members. >> >> Bonus: gets rid of a non-literal format string. A step towards >> compile-time format string checking without triggering >> -Wformat-nonliteral. >> >> Cc: Juan Quintela <quint...@redhat.com> >> Cc: Dr. David Alan Gilbert <dgilb...@redhat.com> >> Signed-off-by: Markus Armbruster <arm...@redhat.com> >> Reviewed-by: Juan Quintela <quint...@redhat.com> >> --- >> tests/migration-test.c | 28 ++++++++++++++++------------ >> 1 file changed, 16 insertions(+), 12 deletions(-) >> > >> +++ b/tests/migration-test.c >> @@ -14,6 +14,7 @@ >> #include "libqtest.h" >> #include "qapi/qmp/qdict.h" >> +#include "qapi/qmp/qjson.h" >> #include "qemu/option.h" >> #include "qemu/range.h" >> #include "qemu/sockets.h" >> @@ -381,16 +382,19 @@ static void migrate_set_capability(QTestState *who, >> const char *capability, >> qobject_unref(rsp); >> } >> -static void migrate(QTestState *who, const char *uri, const char >> *extra) >> +static void migrate(QTestState *who, const char *uri, const char *fmt, ...) >> { > > No gcc attribute?
Good point; adding one. > Reviewed-by: Eric Blake <ebl...@redhat.com> Thanks!