From 3ab72385b21d8d66df3f5fea42097ce264dc9d6b Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Wed, 15 Aug 2018 21:37:37 +0800 Subject: qapi: Drop qapi_event_send_FOO()'s Error ** argument The generated qapi_event_send_FOO() take an Error ** argument. They can't actually fail, because all they do with the argument is passing it to functions that can't fail: the QObject output visitor, and the @qmp_emit callback, which is either monitor_qapi_event_queue() or event_test_emit(). Drop the argument, and pass &error_abort to the QObject output visitor and @qmp_emit instead. Suggested-by: Eric Blake Suggested-by: Markus Armbruster Signed-off-by: Peter Xu Message-Id: <20180815133747.25032-4-peterx@redhat.com> Reviewed-by: Markus Armbruster [Commit message rewritten, update to qapi-code-gen.txt corrected] Signed-off-by: Markus Armbruster --- tests/test-qmp-event.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c index 8677094ad1..9cddd72adb 100644 --- a/tests/test-qmp-event.c +++ b/tests/test-qmp-event.c @@ -95,7 +95,7 @@ static bool qdict_cmp_simple(QDict *a, QDict *b) /* This function is hooked as final emit function, which can verify the correctness. */ -static void event_test_emit(test_QAPIEvent event, QDict *d, Error **errp) +static void event_test_emit(test_QAPIEvent event, QDict *d) { QDict *t; int64_t s, ms; @@ -156,7 +156,7 @@ static void test_event_a(TestEventData *data, QDict *d; d = data->expect; qdict_put_str(d, "event", "EVENT_A"); - qapi_event_send_event_a(&error_abort); + qapi_event_send_event_a(); } static void test_event_b(TestEventData *data, @@ -165,7 +165,7 @@ static void test_event_b(TestEventData *data, QDict *d; d = data->expect; qdict_put_str(d, "event", "EVENT_B"); - qapi_event_send_event_b(&error_abort); + qapi_event_send_event_b(); } static void test_event_c(TestEventData *data, @@ -191,7 +191,7 @@ static void test_event_c(TestEventData *data, qdict_put_str(d, "event", "EVENT_C"); qdict_put(d, "data", d_data); - qapi_event_send_event_c(true, 1, true, &b, "test2", &error_abort); + qapi_event_send_event_c(true, 1, true, &b, "test2"); g_free(b.string); } @@ -233,8 +233,7 @@ static void test_event_d(TestEventData *data, qdict_put_str(d, "event", "EVENT_D"); qdict_put(d, "data", d_data); - qapi_event_send_event_d(&a, "test3", false, NULL, true, ENUM_ONE_VALUE3, - &error_abort); + qapi_event_send_event_d(&a, "test3", false, NULL, true, ENUM_ONE_VALUE3); g_free(struct1.string); g_free(a.string); -- cgit v1.2.3