[PATCH v3 0/3] coroutines: generate wrapper code

Vladimir Sementsov-Ogievskiy posted 3 patches 6 months, 1 week ago
Test docker-mingw@fedora failed
Test checkpatch passed
Test asan failed
Test docker-quick@centos7 failed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200522161950.2839-1-vsementsov@virtuozzo.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Max Reitz <mreitz@redhat.com>, Fam Zheng <fam@euphon.net>, Cleber Rosa <crosa@redhat.com>
Makefile                             |   6 +
block/block-gen.h                    |  30 +++
block/coroutines.h                   |  44 ++++
include/block/block.h                |  17 +-
include/block/generated-co-wrapper.h |  11 +
block.c                              |  78 +------
block/io.c                           | 295 ++-------------------------
block/Makefile.objs                  |   1 +
scripts/coroutine-wrapper.py         | 169 +++++++++++++++
9 files changed, 296 insertions(+), 355 deletions(-)
create mode 100644 block/block-gen.h
create mode 100644 block/coroutines.h
create mode 100644 include/block/generated-co-wrapper.h
create mode 100755 scripts/coroutine-wrapper.py

[PATCH v3 0/3] coroutines: generate wrapper code

Posted by Vladimir Sementsov-Ogievskiy 6 months, 1 week ago
Hi all!

After a long delay (~year) here is a v3.

The aim of the series is to reduce code-duplication and writing
parameters structure-packing by hand around coroutine function wrappers.

It's an alternative to "[PATCH v3] block: Factor out bdrv_run_co()"
patch.

Benefits:
 - no code duplication
 - less indirection

Vladimir Sementsov-Ogievskiy (3):
  block/io: refactor coroutine wrappers
  block: declare some coroutine functions in block/coroutines.h
  block: generate coroutine-wrapper code

 Makefile                             |   6 +
 block/block-gen.h                    |  30 +++
 block/coroutines.h                   |  44 ++++
 include/block/block.h                |  17 +-
 include/block/generated-co-wrapper.h |  11 +
 block.c                              |  78 +------
 block/io.c                           | 295 ++-------------------------
 block/Makefile.objs                  |   1 +
 scripts/coroutine-wrapper.py         | 169 +++++++++++++++
 9 files changed, 296 insertions(+), 355 deletions(-)
 create mode 100644 block/block-gen.h
 create mode 100644 block/coroutines.h
 create mode 100644 include/block/generated-co-wrapper.h
 create mode 100755 scripts/coroutine-wrapper.py

-- 
2.21.0


Re: [PATCH v3 0/3] coroutines: generate wrapper code

Posted by no-reply@patchew.org 6 months, 1 week ago
Patchew URL: https://patchew.org/QEMU/20200522161950.2839-1-vsementsov@virtuozzo.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

/tmp/qemu-test/src/block/io.c:1025: undefined reference to `bdrv_flush'
block/io.o: In function `bdrv_flush_all':
/tmp/qemu-test/src/block/io.c:2170: undefined reference to `bdrv_flush'
block/collect2: error: ld returned 1 exit status
io.o: In function `bdrv_block_status_above':
/tmp/qemu-test/src/block/io.c:2435: undefined reference to `bdrv_common_block_status_above'
/tmp/qemu-test/src/block/io.c:2435: undefined reference to `bdrv_common_block_status_above'
---
/tmp/qemu-test/src/block/io.c:2584: undefined reference to `bdrv_rw_vmstate'
nbd/server.o: In function `nbd_export_new':
/tmp/qemu-test/src/nbd/server.c:1504: undefined reference to `bdrv_invalidate_cache'
collect2: error: ld returned 1 exit status
make: *** [/tmp/qemu-test/src/rules.mak:124: qemu-io.exe] Error 1
make: *** Waiting for unfinished jobs....
make: *** [/tmp/qemu-test/src/rules.mak:124: qemu-img.exe] Error 1
  GEN     x86_64-softmmu/hmp-commands.h
  GEN     x86_64-softmmu/hmp-commands-info.h
  GEN     x86_64-softmmu/config-devices.h
---
/tmp/qemu-test/src/block/io.c:2584: undefined reference to `bdrv_rw_vmstate'
../nbd/server.o: In function `nbd_export_new':
/tmp/qemu-test/src/nbd/server.c:1504: undefined reference to `bdrv_invalidate_cache'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:208: qemu-system-x86_64w.exe] Error 1
make: *** [Makefile:533: x86_64-softmmu/all] Error 2
  LINK    aarch64-softmmu/qemu-system-aarch64w.exe
../blockdev.o: In function `external_snapshot_prepare':
/tmp/qemu-test/src/blockdev.c:1480: undefined reference to `bdrv_flush'
---
/tmp/qemu-test/src/block/io.c:2584: undefined reference to `bdrv_rw_vmstate'
../nbd/server.o: In function `nbd_export_new':
/tmp/qemu-test/src/nbd/server.c:1504: undefined reference to `bdrv_invalidate_cache'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:208: qemu-system-aarch64w.exe] Error 1
make: *** [Makefile:533: aarch64-softmmu/all] Error 2
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=5a1f0334f43e44cea93b4f1fa85d7a08', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-y0bd7no0/src/docker-src.2020-05-22-17.25.42.8055:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=5a1f0334f43e44cea93b4f1fa85d7a08
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-y0bd7no0/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    4m15.085s
user    0m8.269s


The full log is available at
http://patchew.org/logs/20200522161950.2839-1-vsementsov@virtuozzo.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

Re: [PATCH v3 0/3] coroutines: generate wrapper code

Posted by no-reply@patchew.org 6 months, 1 week ago
Patchew URL: https://patchew.org/QEMU/20200522161950.2839-1-vsementsov@virtuozzo.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

/tmp/qemu-test/src/nbd/server.c:1504: undefined reference to `bdrv_invalidate_cache'
/usr/bin/ld: qemu-img.o: in function `collect_image_check':
/tmp/qemu-test/src/qemu-img.c:695: undefined reference to `bdrv_check'
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/tmp/qemu-test/src/rules.mak:124: qemu-io] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/ld:   CC      x86_64-softmmu/accel/stubs/hax-stub.o
block.o: in function `bdrv_reopen_prepare':
---
/usr/bin/ld: block/vhdx-log.o: in function `vhdx_log_write_and_flush':
/tmp/qemu-test/src/block/vhdx-log.c:1049: undefined reference to `bdrv_flush'
/usr/bin/ld: /tmp/qemu-test/src/block/vhdx-log.c:1061: undefined reference to `bdrv_flush'
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/tmp/qemu-test/src/rules.mak:124: qemu-storage-daemon] Error 1
/usr/bin/ld: block/parallels.o: in function `parallels_close':
/tmp/qemu-test/src/block/parallels.c:898: undefined reference to `bdrv_truncate'
/usr/bin/ld: block/parallels.o: in function `parallels_co_check':
---
/tmp/qemu-test/src/block/io.c:2584: undefined reference to `bdrv_rw_vmstate'
/usr/bin/ld: nbd/server.o: in function `nbd_export_new':
/tmp/qemu-test/src/nbd/server.c:1504: undefined reference to `bdrv_invalidate_cache'
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/tmp/qemu-test/src/rules.mak:124: qemu-nbd] Error 1
  CC      x86_64-softmmu/accel/tcg/tcg-runtime-gvec.o
  CC      x86_64-softmmu/accel/tcg/cpu-exec.o
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/tmp/qemu-test/src/rules.mak:124: qemu-img] Error 1
  CC      x86_64-softmmu/accel/tcg/cpu-exec-common.o
  CC      x86_64-softmmu/accel/tcg/translate-all.o
  CC      x86_64-softmmu/accel/tcg/translator.o
---
/tmp/qemu-test/src/block/io.c:2584: undefined reference to `bdrv_rw_vmstate'
/usr/bin/ld: ../nbd/server.o: in function `nbd_export_new':
/tmp/qemu-test/src/nbd/server.c:1504: undefined reference to `bdrv_invalidate_cache'
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:208: qemu-system-x86_64] Error 1
make: *** [Makefile:533: x86_64-softmmu/all] Error 2
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=0ae44f45ff214aacb698f382c823422b', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-dwg_9cv4/src/docker-src.2020-05-22-17.19.04.31012:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=0ae44f45ff214aacb698f382c823422b
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-dwg_9cv4/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    4m51.712s
user    0m9.298s


The full log is available at
http://patchew.org/logs/20200522161950.2839-1-vsementsov@virtuozzo.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

Re: [PATCH v3 0/3] coroutines: generate wrapper code

Posted by no-reply@patchew.org 6 months, 1 week ago
Patchew URL: https://patchew.org/QEMU/20200522161950.2839-1-vsementsov@virtuozzo.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

block/vhdx-log.o: In function `vhdx_log_write_and_flush':
/tmp/qemu-test/src/block/vhdx-log.c:1049: undefined reference to `bdrv_flush'
/tmp/qemu-test/src/block/vhdx-log.c:1061: undefined reference to `bdrv_flush'
collect2: error: ld returned 1 exit status
make: *** [qemu-nbd] Error 1
make: *** Waiting for unfinished jobs....
block.o: In function `bdrv_invalidate_cache_all':
/tmp/qemu-test/src/block.c:5697: undefined reference to `bdrv_invalidate_cache'
---
block/vhdx-log.o: In function `vhdx_log_write_and_flush':
/tmp/qemu-test/src/block/vhdx-log.c:1049: undefined reference to `bdrv_flush'
/tmp/qemu-test/src/block/vhdx-log.c:1061: undefined reference to `bdrv_flush'
collect2: error: ld returned 1 exit status
make: *** [qemu-storage-daemon] Error 1
block.o: In function `bdrv_invalidate_cache_all':
/tmp/qemu-test/src/block.c:5697: undefined reference to `bdrv_invalidate_cache'
block.o: In function `bdrv_close':
---
block/vhdx-log.o: In function `vhdx_log_write_and_flush':
/tmp/qemu-test/src/block/vhdx-log.c:1049: undefined reference to `bdrv_flush'
/tmp/qemu-test/src/block/vhdx-log.c:1061: undefined reference to `bdrv_flush'
collect2: error: ld returned 1 exit status
make: *** [qemu-io] Error 1
  GEN     x86_64-softmmu/config-target.h
  GEN     x86_64-softmmu/hmp-commands.h
  GEN     x86_64-softmmu/hmp-commands-info.h
---
../block/vhdx-log.o: In function `vhdx_log_write_and_flush':
/tmp/qemu-test/src/block/vhdx-log.c:1049: undefined reference to `bdrv_flush'
/tmp/qemu-test/src/block/vhdx-log.c:1061: undefined reference to `bdrv_flush'
collect2: error: ld returned 1 exit status
make[1]: *** [qemu-system-x86_64] Error 1
make: *** [x86_64-softmmu/all] Error 2
../blockdev.o: In function `external_snapshot_prepare':
/tmp/qemu-test/src/blockdev.c:1480: undefined reference to `bdrv_flush'
../block.o: In function `bdrv_invalidate_cache_all':
---
../block/vhdx-log.o: In function `vhdx_log_write_and_flush':
/tmp/qemu-test/src/block/vhdx-log.c:1049: undefined reference to `bdrv_flush'
/tmp/qemu-test/src/block/vhdx-log.c:1061: undefined reference to `bdrv_flush'
collect2: error: ld returned 1 exit status
make[1]: *** [qemu-system-aarch64] Error 1
make: *** [aarch64-softmmu/all] Error 2
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=4d6dd8af9e3d41618b3eefc6134b03c2', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-fojaep43/src/docker-src.2020-05-22-17.15.05.18871:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=4d6dd8af9e3d41618b3eefc6134b03c2
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-fojaep43/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    3m17.180s
user    0m8.686s


The full log is available at
http://patchew.org/logs/20200522161950.2839-1-vsementsov@virtuozzo.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com