Other test code will use the function. Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- tests/Makefile | 1 + tests/coroutine-stub.c | 13 +++++++++++++ tests/test-vmstate.c | 11 ----------- 3 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 tests/coroutine-stub.c
diff --git a/tests/Makefile b/tests/Makefile index f5de29c..483ba61 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -258,6 +258,7 @@ tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \ $(test-qapi-obj-y) \ libqemuutil.a libqemustub.a tests/test-vmstate$(EXESUF): tests/test-vmstate.o \ + tests/coroutine-stub.o \ vmstate.o qemu-file.o \ libqemuutil.a diff --git a/tests/coroutine-stub.c b/tests/coroutine-stub.c new file mode 100644 index 0000000..8af58dd --- /dev/null +++ b/tests/coroutine-stub.c @@ -0,0 +1,13 @@ +#include "qemu-common.h" +#include "block/coroutine.h" + +/* Fake yield_until_fd_readable() implementation so we don't have to pull the + * coroutine code as dependency. + */ +void yield_until_fd_readable(int fd) +{ + fd_set fds; + FD_ZERO(&fds); + FD_SET(fd, &fds); + select(fd + 1, &fds, NULL, NULL, NULL); +} diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index d72c64c..412634f 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -32,17 +32,6 @@ static char temp_file[] = "/tmp/vmst.test.XXXXXX"; static int temp_fd; -/* Fake yield_until_fd_readable() implementation so we don't have to pull the - * coroutine code as dependency. - */ -void yield_until_fd_readable(int fd) -{ - fd_set fds; - FD_ZERO(&fds); - FD_SET(fd, &fds); - select(fd + 1, &fds, NULL, NULL, NULL); -} - /* Duplicate temp_fd and seek to the beginning of the file */ static QEMUFile *open_test_file(bool write) { -- 1.9.3