qemu-e2k/io
Paolo Bonzini 0b8b8753e4 coroutine: move entry argument to qemu_coroutine_create
In practice the entry argument is always known at creation time, and
it is confusing that sometimes qemu_coroutine_enter is used with a
non-NULL argument to re-enter a coroutine (this happens in
block/sheepdog.c and tests/test-coroutine.c).  So pass the opaque value
at creation time, for consistency with e.g. aio_bh_new.

Mostly done with the following semantic patch:

@ entry1 @
expression entry, arg, co;
@@
- co = qemu_coroutine_create(entry);
+ co = qemu_coroutine_create(entry, arg);
  ...
- qemu_coroutine_enter(co, arg);
+ qemu_coroutine_enter(co);

@ entry2 @
expression entry, arg;
identifier co;
@@
- Coroutine *co = qemu_coroutine_create(entry);
+ Coroutine *co = qemu_coroutine_create(entry, arg);
  ...
- qemu_coroutine_enter(co, arg);
+ qemu_coroutine_enter(co);

@ entry3 @
expression entry, arg;
@@
- qemu_coroutine_enter(qemu_coroutine_create(entry), arg);
+ qemu_coroutine_enter(qemu_coroutine_create(entry, arg));

@ reentry @
expression co;
@@
- qemu_coroutine_enter(co, NULL);
+ qemu_coroutine_enter(co);

except for the aforementioned few places where the semantic patch
stumbled (as expected) and for test_co_queue, which would otherwise
produce an uninitialized variable warning.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-07-13 13:26:02 +02:00
..
channel-buffer.c io: avoid double-free when closing QIOChannelBuffer 2016-05-26 11:31:09 +05:30
channel-command.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
channel-file.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
channel-socket.c sockets: Use new QAPI cloning 2016-07-06 10:52:04 +02:00
channel-tls.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
channel-util.c all: Clean up includes 2016-02-23 12:43:05 +00:00
channel-watch.c io: implement socket watch for win32 using WSAEventSelect+select 2016-03-10 17:19:07 +00:00
channel-websock.c qemu-common: stop including qemu/bswap.h from qemu-common.h 2016-05-19 16:42:28 +02:00
channel.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
Makefile.objs io: introduce helper for creating channels from file descriptors 2016-02-15 14:49:00 +00:00
task.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
trace-events trace: split out trace events for io/ directory 2016-06-20 17:22:14 +01:00