include/block/block.h | 1 + include/sysemu/block-backend.h | 2 ++ block.c | 23 +++++++++++++++++++++++ block/block-backend.c | 5 +++++ block/commit.c | 8 +++++++- block/replication.c | 6 ++---- block/vvfat.c | 4 +--- qemu-img.c | 19 ++++++++++++++----- 8 files changed, 55 insertions(+), 13 deletions(-)
Branch: https://github.com/XanClic/qemu.git fix-bdrv_make_empty-v1 Branch: https://git.xanclic.moe/XanClic/qemu.git fix-bdrv_make_empty-v1 Hi, Right now, there is no centralized bdrv_make_empty() function. Not only is it bad style to call BlockDriver methods directly, it is also wrong, unless the caller has a BdrvChild with BLK_PERM_WRITE taken. This series fixes that. Note that as far as I’m aware this series shouldn’t visibly fix anything at this point; but “block: Introduce real BdrvChildRole” (https://lists.nongnu.org/archive/html/qemu-block/2020-02/msg00737.html) makes the iotest break when run with -o data_file=$SOMETHING, without this series applied beforehand. (That is because without that series, external data files are treated much like metadata children, so the format driver always takes the WRITE permission if the file is writable; but after that series, it only does so when it itself has a parent requestion the WRITE permission.) Max Reitz (4): block: Add bdrv_make_empty() block: Use bdrv_make_empty() where possible block: Add blk_make_empty() block: Use blk_make_empty() after commits include/block/block.h | 1 + include/sysemu/block-backend.h | 2 ++ block.c | 23 +++++++++++++++++++++++ block/block-backend.c | 5 +++++ block/commit.c | 8 +++++++- block/replication.c | 6 ++---- block/vvfat.c | 4 +--- qemu-img.c | 19 ++++++++++++++----- 8 files changed, 55 insertions(+), 13 deletions(-) -- 2.25.4
Patchew URL: https://patchew.org/QEMU/20200428132629.796753-1-mreitz@redhat.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 === SIGN pc-bios/optionrom/linuxboot.bin SIGN pc-bios/optionrom/kvmvapic.bin /tmp/qemu-test/src/qemu-img.c: In function 'img_commit': /tmp/qemu-test/src/qemu-img.c:1071:27: error: implicit declaration of function 'blk_new_with_bs'; did you mean 'blk_get_stats'? [-Werror=implicit-function-declaration] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^~~~~~~~~~~~~~~ blk_get_stats /tmp/qemu-test/src/qemu-img.c:1071:27: error: nested extern declaration of 'blk_new_with_bs' [-Werror=nested-externs] /tmp/qemu-test/src/qemu-img.c:1071:25: error: assignment to 'BlockBackend *' {aka 'struct BlockBackend *'} from 'int' makes pointer from integer without a cast [-Werror=int-conversion] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^ cc1: all warnings being treated as errors make: *** [/tmp/qemu-test/src/rules.mak:69: qemu-img.o] Error 1 make: *** Waiting for unfinished jobs.... Traceback (most recent call last): File "./tests/docker/docker.py", line 664, in <module> --- raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=ce8305e22d9c45ed90ec2dc43d7f1cc3', '-u', '1001', '--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/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-kzo016wj/src/docker-src.2020-04-28-10.58.45.27385:/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=ce8305e22d9c45ed90ec2dc43d7f1cc3 make[1]: *** [docker-run] Error 1 make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-kzo016wj/src' make: *** [docker-run-test-mingw@fedora] Error 2 real 3m31.450s user 0m8.978s The full log is available at http://patchew.org/logs/20200428132629.796753-1-mreitz@redhat.com/testing.docker-mingw@fedora/?type=message. --- Email generated automatically by Patchew [https://patchew.org/]. Please send your feedback to patchew-devel@redhat.com
Patchew URL: https://patchew.org/QEMU/20200428132629.796753-1-mreitz@redhat.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 === CC aarch64-softmmu/exec-vary.o CC aarch64-softmmu/tcg/tcg.o /tmp/qemu-test/src/qemu-img.c: In function 'img_commit': /tmp/qemu-test/src/qemu-img.c:1071:27: error: implicit declaration of function 'blk_new_with_bs'; did you mean 'blk_get_stats'? [-Werror=implicit-function-declaration] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^~~~~~~~~~~~~~~ blk_get_stats /tmp/qemu-test/src/qemu-img.c:1071:27: error: nested extern declaration of 'blk_new_with_bs' [-Werror=nested-externs] /tmp/qemu-test/src/qemu-img.c:1071:25: error: assignment to 'BlockBackend *' {aka 'struct BlockBackend *'} from 'int' makes pointer from integer without a cast [-Werror=int-conversion] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^ cc1: all warnings being treated as errors make: *** [/tmp/qemu-test/src/rules.mak:69: qemu-img.o] Error 1 make: *** Waiting for unfinished jobs.... CC aarch64-softmmu/tcg/tcg-op.o CC aarch64-softmmu/tcg/tcg-op-vec.o --- raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=7e33797e28514c48a1cce7021d8b04fd', '-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-dh8ik377/src/docker-src.2020-04-28-09.44.17.22581:/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=7e33797e28514c48a1cce7021d8b04fd make[1]: *** [docker-run] Error 1 make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-dh8ik377/src' make: *** [docker-run-test-mingw@fedora] Error 2 real 4m4.967s user 0m8.349s The full log is available at http://patchew.org/logs/20200428132629.796753-1-mreitz@redhat.com/testing.docker-mingw@fedora/?type=message. --- Email generated automatically by Patchew [https://patchew.org/]. Please send your feedback to patchew-devel@redhat.com
On 4/28/20 8:26 AM, Max Reitz wrote: > Branch: https://github.com/XanClic/qemu.git fix-bdrv_make_empty-v1 > Branch: https://git.xanclic.moe/XanClic/qemu.git fix-bdrv_make_empty-v1 > > Hi, > > Right now, there is no centralized bdrv_make_empty() function. Not only > is it bad style to call BlockDriver methods directly, it is also wrong, > unless the caller has a BdrvChild with BLK_PERM_WRITE taken. I'm also in the middle of writing a patch series that adds a corresponding .bdrv_make_empty driver callback. I'll rebase that work on top of this, as part of my efforts at fixing more code to rely on bdrv_make_empty rather than directly querying bdrv_has_zero_init[_truncate]. > > This series fixes that. > > Note that as far as I’m aware this series shouldn’t visibly fix anything > at this point; but “block: Introduce real BdrvChildRole” > (https://lists.nongnu.org/archive/html/qemu-block/2020-02/msg00737.html) > makes the iotest break when run with -o data_file=$SOMETHING, without > this series applied beforehand. (That is because without that series, > external data files are treated much like metadata children, so the > format driver always takes the WRITE permission if the file is writable; > but after that series, it only does so when it itself has a parent > requestion the WRITE permission.) > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
On 4/28/20 8:49 AM, Eric Blake wrote: > On 4/28/20 8:26 AM, Max Reitz wrote: >> Branch: https://github.com/XanClic/qemu.git fix-bdrv_make_empty-v1 >> Branch: https://git.xanclic.moe/XanClic/qemu.git fix-bdrv_make_empty-v1 >> >> Hi, >> >> Right now, there is no centralized bdrv_make_empty() function. Not only >> is it bad style to call BlockDriver methods directly, it is also wrong, >> unless the caller has a BdrvChild with BLK_PERM_WRITE taken. > > I'm also in the middle of writing a patch series that adds a > corresponding .bdrv_make_empty driver callback. I'll rebase that work > on top of this, as part of my efforts at fixing more code to rely on > bdrv_make_empty rather than directly querying > bdrv_has_zero_init[_truncate]. Correction - I'm working on adding .bdrv_make_zero, not .bdrv_make empty (which already exists), although maybe it really only needs to be one callback instead of two if we have decent flags. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Patchew URL: https://patchew.org/QEMU/20200428132629.796753-1-mreitz@redhat.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 === BUILD pc-bios/optionrom/pvh.img BUILD pc-bios/optionrom/pvh.raw SIGN pc-bios/optionrom/pvh.bin /tmp/qemu-test/src/qemu-img.c:1071:27: error: implicit declaration of function 'blk_new_with_bs' is invalid in C99 [-Werror,-Wimplicit-function-declaration] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^ /tmp/qemu-test/src/qemu-img.c:1071:27: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] /tmp/qemu-test/src/qemu-img.c:1071:25: error: incompatible integer to pointer conversion assigning to 'BlockBackend *' (aka 'struct BlockBackend *') from 'int' [-Werror,-Wint-conversion] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 errors generated. make: *** [/tmp/qemu-test/src/rules.mak:69: qemu-img.o] Error 1 make: *** Waiting for unfinished jobs.... Traceback (most recent call last): File "./tests/docker/docker.py", line 664, in <module> --- raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=c01c8a7b80794cb2a4458fd17b18ff83', '-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-7kkbz7sd/src/docker-src.2020-04-28-10.48.39.6384:/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=c01c8a7b80794cb2a4458fd17b18ff83 make[1]: *** [docker-run] Error 1 make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-7kkbz7sd/src' make: *** [docker-run-test-debug@fedora] Error 2 real 4m22.457s user 0m8.829s The full log is available at http://patchew.org/logs/20200428132629.796753-1-mreitz@redhat.com/testing.asan/?type=message. --- Email generated automatically by Patchew [https://patchew.org/]. Please send your feedback to patchew-devel@redhat.com
Patchew URL: https://patchew.org/QEMU/20200428132629.796753-1-mreitz@redhat.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 === SIGN pc-bios/optionrom/linuxboot.bin SIGN pc-bios/optionrom/kvmvapic.bin /tmp/qemu-test/src/qemu-img.c: In function 'img_commit': /tmp/qemu-test/src/qemu-img.c:1071:9: error: implicit declaration of function 'blk_new_with_bs' [-Werror=implicit-function-declaration] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^ /tmp/qemu-test/src/qemu-img.c:1071:9: error: nested extern declaration of 'blk_new_with_bs' [-Werror=nested-externs] /tmp/qemu-test/src/qemu-img.c:1071:25: error: assignment makes pointer from integer without a cast [-Werror] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^ cc1: all warnings being treated as errors make: *** [qemu-img.o] Error 1 make: *** Waiting for unfinished jobs.... Traceback (most recent call last): File "./tests/docker/docker.py", line 664, in <module> --- raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=46a96d39761c47298a2d1eaffd870dde', '-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-5y1a3roy/src/docker-src.2020-04-28-10.55.01.17538:/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=46a96d39761c47298a2d1eaffd870dde make[1]: *** [docker-run] Error 1 make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-5y1a3roy/src' make: *** [docker-run-test-quick@centos7] Error 2 real 2m49.941s user 0m8.502s The full log is available at http://patchew.org/logs/20200428132629.796753-1-mreitz@redhat.com/testing.docker-quick@centos7/?type=message. --- Email generated automatically by Patchew [https://patchew.org/]. Please send your feedback to patchew-devel@redhat.com
Patchew URL: https://patchew.org/QEMU/20200428132629.796753-1-mreitz@redhat.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 === SIGN pc-bios/optionrom/kvmvapic.bin BUILD pc-bios/optionrom/pvh.raw SIGN pc-bios/optionrom/pvh.bin /tmp/qemu-test/src/qemu-img.c:1071:27: error: implicit declaration of function 'blk_new_with_bs' is invalid in C99 [-Werror,-Wimplicit-function-declaration] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^ /tmp/qemu-test/src/qemu-img.c:1071:27: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] /tmp/qemu-test/src/qemu-img.c:1071:25: error: incompatible integer to pointer conversion assigning to 'BlockBackend *' (aka 'struct BlockBackend *') from 'int' [-Werror,-Wint-conversion] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 errors generated. make: *** [/tmp/qemu-test/src/rules.mak:69: qemu-img.o] Error 1 make: *** Waiting for unfinished jobs.... Traceback (most recent call last): File "./tests/docker/docker.py", line 664, in <module> --- raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=1896d2b1f1044091b832be313d66ac6e', '-u', '1003', '--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/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-fql9ti5h/src/docker-src.2020-04-28-09.34.00.5332:/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=1896d2b1f1044091b832be313d66ac6e make[1]: *** [docker-run] Error 1 make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-fql9ti5h/src' make: *** [docker-run-test-debug@fedora] Error 2 real 4m44.194s user 0m8.084s The full log is available at http://patchew.org/logs/20200428132629.796753-1-mreitz@redhat.com/testing.asan/?type=message. --- Email generated automatically by Patchew [https://patchew.org/]. Please send your feedback to patchew-devel@redhat.com
Patchew URL: https://patchew.org/QEMU/20200428132629.796753-1-mreitz@redhat.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 === BUILD pc-bios/optionrom/pvh.raw SIGN pc-bios/optionrom/pvh.bin /tmp/qemu-test/src/qemu-img.c: In function 'img_commit': /tmp/qemu-test/src/qemu-img.c:1071:9: error: implicit declaration of function 'blk_new_with_bs' [-Werror=implicit-function-declaration] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^ /tmp/qemu-test/src/qemu-img.c:1071:9: error: nested extern declaration of 'blk_new_with_bs' [-Werror=nested-externs] /tmp/qemu-test/src/qemu-img.c:1071:25: error: assignment makes pointer from integer without a cast [-Werror] old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, ^ cc1: all warnings being treated as errors make: *** [qemu-img.o] Error 1 make: *** Waiting for unfinished jobs.... Traceback (most recent call last): File "./tests/docker/docker.py", line 664, in <module> --- raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=2d32da85331c4d51b4632262369586d1', '-u', '1003', '--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/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-mtvq5xk5/src/docker-src.2020-04-28-09.40.27.12753:/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=2d32da85331c4d51b4632262369586d1 make[1]: *** [docker-run] Error 1 make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-mtvq5xk5/src' make: *** [docker-run-test-quick@centos7] Error 2 real 2m58.028s user 0m8.393s The full log is available at http://patchew.org/logs/20200428132629.796753-1-mreitz@redhat.com/testing.docker-quick@centos7/?type=message. --- Email generated automatically by Patchew [https://patchew.org/]. Please send your feedback to patchew-devel@redhat.com
On 4/28/20 8:43 AM, no-reply@patchew.org wrote: > Patchew URL: https://patchew.org/QEMU/20200428132629.796753-1-mreitz@redhat.com/ > > > SIGN pc-bios/optionrom/pvh.bin > /tmp/qemu-test/src/qemu-img.c: In function 'img_commit': > /tmp/qemu-test/src/qemu-img.c:1071:9: error: implicit declaration of function 'blk_new_with_bs' [-Werror=implicit-function-declaration] > old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL, Ah, you forgot to tell patchew: Based-on: <20200424190903.522087-1-eblake@redhat.com> [PATCH v3 0/3] qcow2: Allow resize of images with internal snapshots -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
© 2016 - 2024 Red Hat, Inc.