qemu/util
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
..
acl.c Drop Emacs local variables lists redundant with .dir-locals.el 2016-07-12 16:19:16 +02:00
base64.c
bitmap.c
bitops.c
buffer.c
compatfd.c
coroutine-gthread.c all: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-win32.c
crc32c.c
cutils.c avx2 configure: Use primitives in test 2016-06-16 18:39:04 +02:00
envlist.c
error.c migration: add reporting of errors for outgoing migration 2016-05-26 11:31:30 +05:30
event_notifier-posix.c
event_notifier-win32.c
fifo8.c
getauxval.c
hbitmap.c hbitmap: add 'pos < size' asserts 2016-06-16 15:20:37 +02:00
hexdump.c
host-utils.c
id.c
iov.c
log.c log: Permit -dfilter 0..0xffffffffffffffff 2016-07-04 16:49:33 +03:00
Makefile.objs range: Create range.c for code that should not be inline 2016-06-30 15:28:40 +02:00
memfd.c os-posix: include sys/mman.h 2016-06-16 18:39:03 +02:00
mmap-alloc.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
module.c coccinelle: Remove unnecessary variables for function return value 2016-06-20 16:38:13 +02:00
notify.c
osdep.c osdep: Introduce qemu_dup 2016-07-13 13:26:02 +02:00
oslib-posix.c Use #include "..." for our own headers, <...> for others 2016-07-12 16:19:16 +02:00
oslib-win32.c all: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
path.c
qdist.c clean-includes: run it once more 2016-06-16 18:39:03 +02:00
qemu-config.c
qemu-coroutine-io.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
qemu-coroutine-lock.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
qemu-coroutine-sleep.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
qemu-coroutine.c coroutine: move entry argument to qemu_coroutine_create 2016-07-13 13:26:02 +02:00
qemu-error.c
qemu-openpty.c
qemu-option.c
qemu-progress.c
qemu-sockets.c sockets: Use new QAPI cloning 2016-07-06 10:52:04 +02:00
qemu-thread-posix.c
qemu-thread-win32.c
qemu-timer-common.c
qht.c clean-includes: run it once more 2016-06-16 18:39:03 +02:00
range.c range: Replace internal representation of Range 2016-07-04 16:49:33 +03:00
rcu.c
readline.c
rfifolock.c
throttle.c throttle: refuse iops-size without iops-total/read/write 2016-06-07 14:40:51 +01:00
timed-average.c
trace-events trace: split out trace events for util/ directory 2016-06-20 17:22:14 +01:00
unicode.c
uri.c all: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00