From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3iuT-0008S9-L6 for qemu-devel@nongnu.org; Mon, 29 Jul 2013 04:34:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3iuK-0007c5-ND for qemu-devel@nongnu.org; Mon, 29 Jul 2013 04:34:29 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:41617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3iuK-0007br-2w for qemu-devel@nongnu.org; Mon, 29 Jul 2013 04:34:20 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Jul 2013 13:55:03 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 2B0C4E004F for ; Mon, 29 Jul 2013 14:04:20 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6T8ZCrk44826686 for ; Mon, 29 Jul 2013 14:05:12 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6T8YDEA013712 for ; Mon, 29 Jul 2013 18:34:13 +1000 Message-ID: <51F62900.5030609@linux.vnet.ibm.com> Date: Mon, 29 Jul 2013 16:34:08 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1374765505-14356-1-git-send-email-stefanha@redhat.com> <1374765505-14356-18-git-send-email-stefanha@redhat.com> In-Reply-To: <1374765505-14356-18-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 17/18] tests: drop event_active_cb() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Ping Fan Liu , qemu-devel@nongnu.org, Michael Roth , alex@alex.org.uk, Paolo Bonzini Reviewed-by: Wenchao Xia > Drop the io_flush argument to aio_set_event_notifier(). > > Reviewed-by: Paolo Bonzini > Signed-off-by: Stefan Hajnoczi > --- > tests/test-aio.c | 22 ++++++++-------------- > 1 file changed, 8 insertions(+), 14 deletions(-) > > diff --git a/tests/test-aio.c b/tests/test-aio.c > index 1251952..7b2892a 100644 > --- a/tests/test-aio.c > +++ b/tests/test-aio.c > @@ -65,12 +65,6 @@ static void bh_delete_cb(void *opaque) > } > } > > -static int event_active_cb(EventNotifier *e) > -{ > - EventNotifierTestData *data = container_of(e, EventNotifierTestData, e); > - return data->active > 0; > -} > - > static void event_ready_cb(EventNotifier *e) > { > EventNotifierTestData *data = container_of(e, EventNotifierTestData, e); > @@ -239,7 +233,7 @@ static void test_set_event_notifier(void) > { > EventNotifierTestData data = { .n = 0, .active = 0 }; > event_notifier_init(&data.e, false); > - aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb); > + aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL); > g_assert(!aio_poll(ctx, false)); > g_assert_cmpint(data.n, ==, 0); > > @@ -253,7 +247,7 @@ static void test_wait_event_notifier(void) > { > EventNotifierTestData data = { .n = 0, .active = 1 }; > event_notifier_init(&data.e, false); > - aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb); > + aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL); > g_assert(!aio_poll(ctx, false)); > g_assert_cmpint(data.n, ==, 0); > g_assert_cmpint(data.active, ==, 1); > @@ -278,7 +272,7 @@ static void test_flush_event_notifier(void) > { > EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true }; > event_notifier_init(&data.e, false); > - aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb); > + aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL); > g_assert(!aio_poll(ctx, false)); > g_assert_cmpint(data.n, ==, 0); > g_assert_cmpint(data.active, ==, 10); > @@ -318,7 +312,7 @@ static void test_wait_event_notifier_noflush(void) > > /* An active event notifier forces aio_poll to look at EventNotifiers. */ > event_notifier_init(&dummy.e, false); > - aio_set_event_notifier(ctx, &dummy.e, event_ready_cb, event_active_cb); > + aio_set_event_notifier(ctx, &dummy.e, event_ready_cb, NULL); > > event_notifier_set(&data.e); > g_assert(aio_poll(ctx, false)); > @@ -521,7 +515,7 @@ static void test_source_set_event_notifier(void) > { > EventNotifierTestData data = { .n = 0, .active = 0 }; > event_notifier_init(&data.e, false); > - aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb); > + aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL); > while (g_main_context_iteration(NULL, false)); > g_assert_cmpint(data.n, ==, 0); > > @@ -535,7 +529,7 @@ static void test_source_wait_event_notifier(void) > { > EventNotifierTestData data = { .n = 0, .active = 1 }; > event_notifier_init(&data.e, false); > - aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb); > + aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL); > g_assert(g_main_context_iteration(NULL, false)); > g_assert_cmpint(data.n, ==, 0); > g_assert_cmpint(data.active, ==, 1); > @@ -560,7 +554,7 @@ static void test_source_flush_event_notifier(void) > { > EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true }; > event_notifier_init(&data.e, false); > - aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb); > + aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL); > g_assert(g_main_context_iteration(NULL, false)); > g_assert_cmpint(data.n, ==, 0); > g_assert_cmpint(data.active, ==, 10); > @@ -600,7 +594,7 @@ static void test_source_wait_event_notifier_noflush(void) > > /* An active event notifier forces aio_poll to look at EventNotifiers. */ > event_notifier_init(&dummy.e, false); > - aio_set_event_notifier(ctx, &dummy.e, event_ready_cb, event_active_cb); > + aio_set_event_notifier(ctx, &dummy.e, event_ready_cb, NULL); > > event_notifier_set(&data.e); > g_assert(g_main_context_iteration(NULL, false)); > -- Best Regards Wenchao Xia