qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] c37c97: block/accounting: Use lock guard macr


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] c37c97: block/accounting: Use lock guard macros
Date: Fri, 11 Dec 2020 16:47:56 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: c37c97366097a5ce1919d6fe12535e5f889b0317
      
https://github.com/qemu/qemu/commit/c37c97366097a5ce1919d6fe12535e5f889b0317
  Author: Gan Qixin <ganqixin@huawei.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/accounting.c

  Log Message:
  -----------
  block/accounting: Use lock guard macros

Replace manual lock()/unlock() calls with lock guard macros
(QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/accounting.

Signed-off-by: Gan Qixin <ganqixin@huawei.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201203075055.127773-2-ganqixin@huawei.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: f5056b70e631ad1c2b058223f9cc68a3ea510163
      
https://github.com/qemu/qemu/commit/f5056b70e631ad1c2b058223f9cc68a3ea510163
  Author: Gan Qixin <ganqixin@huawei.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/curl.c

  Log Message:
  -----------
  block/curl: Use lock guard macros

Replace manual lock()/unlock() calls with lock guard macros
(QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/curl.

Signed-off-by: Gan Qixin <ganqixin@huawei.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201203075055.127773-3-ganqixin@huawei.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 3af613ebdb32453469018e5431452ce9a53ea69c
      
https://github.com/qemu/qemu/commit/3af613ebdb32453469018e5431452ce9a53ea69c
  Author: Gan Qixin <ganqixin@huawei.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/throttle-groups.c

  Log Message:
  -----------
  block/throttle-groups: Use lock guard macros

Replace manual lock()/unlock() calls with lock guard macros
(QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/throttle-groups.

Signed-off-by: Gan Qixin <ganqixin@huawei.com>
Message-Id: <20201203075055.127773-4-ganqixin@huawei.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c208b0ef968b108440b01a319b3699f1d330fbb1
      
https://github.com/qemu/qemu/commit/c208b0ef968b108440b01a319b3699f1d330fbb1
  Author: Gan Qixin <ganqixin@huawei.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  block/iscsi: Use lock guard macros

Replace manual lock()/unlock() calls with lock guard macros
(QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/iscsi.

Signed-off-by: Gan Qixin <ganqixin@huawei.com>
Message-Id: <20201203075055.127773-5-ganqixin@huawei.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: a484a7195761476dcf43b40437f4d5b8b32d9f2c
      
https://github.com/qemu/qemu/commit/a484a7195761476dcf43b40437f4d5b8b32d9f2c
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M configure
    M meson.build
    M meson_options.txt

  Log Message:
  -----------
  meson: Detect libfuse

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201027190600.192171-2-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 0c9b70d5900a5108e899edfdd6f3790f8cb6bdc2
      
https://github.com/qemu/qemu/commit/0c9b70d5900a5108e899edfdd6f3790f8cb6bdc2
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M MAINTAINERS
    M block.c
    M block/export/export.c
    A block/export/fuse.c
    M block/export/meson.build
    A include/block/fuse.h
    M qapi/block-export.json

  Log Message:
  -----------
  fuse: Allow exporting BDSs via FUSE

block-export-add type=fuse allows mounting block graph nodes via FUSE on
some existing regular file.  That file should then appears like a raw
disk image, and accesses to it result in accesses to the exported BDS.

Right now, we only implement the necessary block export functions to set
it up and shut it down.  We do not implement any access functions, so
accessing the mount point only results in errors.  This will be
addressed by a followup patch.

We keep a hash table of exported mount points, because we want to be
able to detect when users try to use a mount point twice.  This is
because we invoke stat() to check whether the given mount point is a
regular file, but if that file is served by ourselves (because it is
already used as a mount point), then this stat() would have to be served
by ourselves, too, which is impossible to do while we (as the caller)
are waiting for it to settle.  Therefore, keep track of mount point
paths to at least catch the most obvious instances of that problem.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201027190600.192171-3-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 41429e3d79c331503a87ec23b5da3cc1440a73fa
      
https://github.com/qemu/qemu/commit/41429e3d79c331503a87ec23b5da3cc1440a73fa
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/export/fuse.c

  Log Message:
  -----------
  fuse: Implement standard FUSE operations

This makes the export actually useful instead of only producing errors
whenever it is accessed.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201027190600.192171-4-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 4fba06d5941e74169a6d33bcfd09093a49dd311f
      
https://github.com/qemu/qemu/commit/4fba06d5941e74169a6d33bcfd09093a49dd311f
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/export/fuse.c
    M qapi/block-export.json

  Log Message:
  -----------
  fuse: Allow growable exports

These will behave more like normal files in that writes beyond the EOF
will automatically grow the export size.

As an optimization, keep the RESIZE permission for growable exports so
we do not have to take it for every post-EOF write.  (This permission is
not released when the export is destroyed, because at that point the
BlockBackend is destroyed altogether anyway.)

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201027190600.192171-5-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 4ca37a96a75aafe7a37ba51ab1912b09b7190a6b
      
https://github.com/qemu/qemu/commit/4ca37a96a75aafe7a37ba51ab1912b09b7190a6b
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/export/fuse.c

  Log Message:
  -----------
  fuse: (Partially) implement fallocate()

This allows allocating areas after the (old) EOF as part of a growing
resize, writing zeroes, and discarding.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201027190600.192171-6-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: df4ea7091b744c8568e8bd9212a756ac504c43d4
      
https://github.com/qemu/qemu/commit/df4ea7091b744c8568e8bd9212a756ac504c43d4
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/export/fuse.c
    M configure
    M meson.build
    M meson_options.txt

  Log Message:
  -----------
  fuse: Implement hole detection through lseek

This is a relatively new feature in libfuse (available since 3.8.0,
which was released in November 2019), so we have to add a dedicated
check whether it is available before making use of it.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201027190600.192171-7-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: f96e59da1ff5b5bf55a1dc6c442cb34a941cff12
      
https://github.com/qemu/qemu/commit/f96e59da1ff5b5bf55a1dc6c442cb34a941cff12
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/161
    M tests/qemu-iotests/175
    M tests/qemu-iotests/249

  Log Message:
  -----------
  iotests: Do not needlessly filter _make_test_img

In most cases, _make_test_img does not need a _filter_imgfmt on top.  It
does that by itself.

(The exception is when IMGFMT has been overwritten but TEST_IMG has not.
In such cases, we do need a _filter_imgfmt on top to filter the test's
original IMGFMT from TEST_IMG.)

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-8-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: d81fe252a22d0cbcf78931b9ab3445ad9c30638e
      
https://github.com/qemu/qemu/commit/d81fe252a22d0cbcf78931b9ab3445ad9c30638e
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/071
    M tests/qemu-iotests/174

  Log Message:
  -----------
  iotests: Do not pipe _make_test_img

Executing _make_test_img as part of a pipe will undo all variable
changes it has done.  As such, this could not work with FUSE (because
we want to remember all of our exports and their qemu instances).

Replace the pipe by a temporary file in 071 and 174 (the two tests that
can run on FUSE).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-9-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 620a628db02a3649705a975df8c00a4c6563788a
      
https://github.com/qemu/qemu/commit/620a628db02a3649705a975df8c00a4c6563788a
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/028
    M tests/qemu-iotests/028.out
    M tests/qemu-iotests/089
    M tests/qemu-iotests/089.out

  Log Message:
  -----------
  iotests: Use convert -n in some cases

qemu-img convert (without -n) can often be replaced by a combination of
_make_test_img + qemu-img convert -n.  Doing so allows converting to
protocols that do not allow direct file creation, such as FUSE exports.
The only problem is that for formats other than qcow2 and qed (qcow1 at
least), this may lead to high disk usage for some reason, so we cannot
do it everywhere.

But we can do it in 028 and 089, so let us do that so they can run on
FUSE exports.  Also, in 028 this allows us to remove a 9-line comment
that used to explain why we cannot safely filter drive-backup's image
creation output.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-10-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 63c17df7a4a12ccb0c5355c7429bdee943a4aa1d
      
https://github.com/qemu/qemu/commit/63c17df7a4a12ccb0c5355c7429bdee943a4aa1d
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/046
    M tests/qemu-iotests/046.out

  Log Message:
  -----------
  iotests/046: Avoid renaming images

This generally does not work on non-file protocols.  It is better to
create the image with the final name from the start, and most tests do
this already.  Let 046 follow suit.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-11-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 4c36f030638e121872386cd1d3725e745a30d943
      
https://github.com/qemu/qemu/commit/4c36f030638e121872386cd1d3725e745a30d943
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/200
    M tests/qemu-iotests/200.out
    M tests/qemu-iotests/229
    M tests/qemu-iotests/229.out

  Log Message:
  -----------
  iotests: Derive image names from $TEST_IMG

Avoid creating images with custom filenames in $TEST_DIR, because
non-file protocols may want to keep $TEST_IMG (and all other test
images) in some other directory.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-12-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: b4a373bc1c7c491a75d07b962841e092bbc77f64
      
https://github.com/qemu/qemu/commit/b4a373bc1c7c491a75d07b962841e092bbc77f64
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/091

  Log Message:
  -----------
  iotests/091: Use _cleanup_qemu instad of "wait"

If the test environment has some other child processes running (like a
storage daemon that provides a FUSE export), then "wait" will never
finish.  Use wait=yes _cleanup_qemu instead.

(We need to discard the output so there is no change to the reference
output.)

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-13-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: eda7a9c5740ffe72442ce8d078f95d5fd7449c5c
      
https://github.com/qemu/qemu/commit/eda7a9c5740ffe72442ce8d078f95d5fd7449c5c
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/206
    M tests/qemu-iotests/242

  Log Message:
  -----------
  iotests: Restrict some Python tests to file

Most Python tests are restricted to the file protocol (without
explicitly saying so), but these are the ones that would break
./check -fuse -qcow2.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-14-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: d2d5310c8e892b8b3e853e762f0d1785257e05e5
      
https://github.com/qemu/qemu/commit/d2d5310c8e892b8b3e853e762f0d1785257e05e5
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/common.rc

  Log Message:
  -----------
  iotests: Let _make_test_img guess $TEST_IMG_FILE

When most iotests want to create a test image that is named differently
from the default $TEST_IMG, they do something like this:

    TEST_IMG="$TEST_IMG.base" _make_test_img $options

This works fine with the "file" protocol, but not so much for anything
else: _make_test_img tries to create an image under $TEST_IMG_FILE
first, and only under $TEST_IMG if the former is not set; and on
everything but "file", $TEST_IMG_FILE is set.

There are two ways we can fix this: First, we could make all tests
adjust not only TEST_IMG, but also TEST_IMG_FILE if that is present
(e.g. with something like _set_test_img_suffix $suffix that would affect
not only TEST_IMG but also TEST_IMG_FILE, if necessary).  This is a
pretty clean solution, and this is maybe what we should have done from
the start.

But it would also require changes to most existing bash tests.  So the
alternative is this: Let _make_test_img see whether $TEST_IMG_FILE still
points to the original value.  If so, it is possible that the caller has
adjusted $TEST_IMG but not $TEST_IMG_FILE.  In such a case, we can (for
most protocols) derive the corresponding $TEST_IMG_FILE value from
$TEST_IMG value and thus work around what technically is the caller
misbehaving.

This second solution is less clean, but it is robust against people
keeping their old habit of adjusting TEST_IMG only, and requires much
less changes.  So this patch implements it.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-15-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 7eadb1e59d331563ad6a1c3efd5ce14357de7344
      
https://github.com/qemu/qemu/commit/7eadb1e59d331563ad6a1c3efd5ce14357de7344
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/287

  Log Message:
  -----------
  iotests/287: Clean up subshell test image

287 creates an image in a subshell (thanks to the pipe) to see whether
that is possible with compression_type=zstd.  If _make_test_img were to
modify any global state, this global state would then be lost before we
could cleanup the image.

When using FUSE as the test protocol, this global state is important, so
clean up the image before the state is lost.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-16-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: b55a3c8860b763b62b2cc2f4a6f55379977bbde5
      
https://github.com/qemu/qemu/commit/b55a3c8860b763b62b2cc2f4a6f55379977bbde5
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M storage-daemon/qemu-storage-daemon.c

  Log Message:
  -----------
  storage-daemon: Call bdrv_close_all() on exit

Otherwise, exports and block devices are not properly shut down and
closed, unless the users explicitly issues blockdev-del and
block-export-del commands for each of them.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-17-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: cc575c3edb5467d7faf8a0ec813f81e4d598637b
      
https://github.com/qemu/qemu/commit/cc575c3edb5467d7faf8a0ec813f81e4d598637b
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/check
    M tests/qemu-iotests/common.rc

  Log Message:
  -----------
  iotests: Give access to the qemu-storage-daemon

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201027190600.192171-18-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: f96ac06bf076db4f7c97509446b409d0d6d06276
      
https://github.com/qemu/qemu/commit/f96ac06bf076db4f7c97509446b409d0d6d06276
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/check
    M tests/qemu-iotests/common.filter
    M tests/qemu-iotests/common.rc

  Log Message:
  -----------
  iotests: Allow testing FUSE exports

This pretends FUSE exports are a kind of protocol.  As such, they are
always tested under the format node.  This is probably the best way to
test them, actually, because this will generate more I/O load and more
varied patterns.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201027190600.192171-19-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 57284d2ada481fe557c9a2f00228eca2a83e1d60
      
https://github.com/qemu/qemu/commit/57284d2ada481fe557c9a2f00228eca2a83e1d60
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/025
    M tests/qemu-iotests/026
    M tests/qemu-iotests/028
    M tests/qemu-iotests/031
    M tests/qemu-iotests/034
    M tests/qemu-iotests/036
    M tests/qemu-iotests/037
    M tests/qemu-iotests/038
    M tests/qemu-iotests/039
    M tests/qemu-iotests/046
    M tests/qemu-iotests/050
    M tests/qemu-iotests/054
    M tests/qemu-iotests/060
    M tests/qemu-iotests/071
    M tests/qemu-iotests/079
    M tests/qemu-iotests/080
    M tests/qemu-iotests/089
    M tests/qemu-iotests/090
    M tests/qemu-iotests/091
    M tests/qemu-iotests/095
    M tests/qemu-iotests/097
    M tests/qemu-iotests/098
    M tests/qemu-iotests/102
    M tests/qemu-iotests/103
    M tests/qemu-iotests/106
    M tests/qemu-iotests/107
    M tests/qemu-iotests/108
    M tests/qemu-iotests/111
    M tests/qemu-iotests/112
    M tests/qemu-iotests/115
    M tests/qemu-iotests/117
    M tests/qemu-iotests/120
    M tests/qemu-iotests/121
    M tests/qemu-iotests/127
    M tests/qemu-iotests/133
    M tests/qemu-iotests/137
    M tests/qemu-iotests/138
    M tests/qemu-iotests/140
    M tests/qemu-iotests/154
    M tests/qemu-iotests/161
    M tests/qemu-iotests/171
    M tests/qemu-iotests/175
    M tests/qemu-iotests/176
    M tests/qemu-iotests/177
    M tests/qemu-iotests/179
    M tests/qemu-iotests/183
    M tests/qemu-iotests/186
    M tests/qemu-iotests/187
    M tests/qemu-iotests/191
    M tests/qemu-iotests/195
    M tests/qemu-iotests/200
    M tests/qemu-iotests/204
    M tests/qemu-iotests/214
    M tests/qemu-iotests/217
    M tests/qemu-iotests/220
    M tests/qemu-iotests/221
    M tests/qemu-iotests/229
    M tests/qemu-iotests/247
    M tests/qemu-iotests/249
    M tests/qemu-iotests/250
    M tests/qemu-iotests/252
    M tests/qemu-iotests/265
    M tests/qemu-iotests/268
    M tests/qemu-iotests/272
    M tests/qemu-iotests/273
    M tests/qemu-iotests/279
    M tests/qemu-iotests/286
    M tests/qemu-iotests/287
    M tests/qemu-iotests/289
    M tests/qemu-iotests/290
    M tests/qemu-iotests/291
    M tests/qemu-iotests/292
    M tests/qemu-iotests/293
    M tests/qemu-iotests/294
    M tests/qemu-iotests/305

  Log Message:
  -----------
  iotests: Enable fuse for many tests

Many tests (that do not support generic protocols) can run just fine
with FUSE-exported images, so allow them to.  Note that this is no
attempt at being definitely complete.  There are some tests that might
be modified to run on FUSE, but this patch still skips them.  This patch
only tries to pick the rather low-hanging fruits.

Note that 221 and 250 only pass when .lseek is correctly implemented,
which is only possible with a libfuse that is 3.8 or newer.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-20-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: e6c7964769f68c36e2b20c26f5bf4da91dfa0cac
      
https://github.com/qemu/qemu/commit/e6c7964769f68c36e2b20c26f5bf4da91dfa0cac
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    A tests/qemu-iotests/308
    A tests/qemu-iotests/308.out
    M tests/qemu-iotests/group

  Log Message:
  -----------
  iotests/308: Add test for FUSE exports

We have good coverage of the normal I/O paths now, but what remains is a
test that tests some more special cases: Exporting an image on itself
(thus turning a formatted image into a raw one), some error cases, and
non-writable and non-growable exports.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201027190600.192171-21-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: eb43ea16dcb7e6ab01db321b5edac3e593556e7d
      
https://github.com/qemu/qemu/commit/eb43ea16dcb7e6ab01db321b5edac3e593556e7d
  Author: Li Feng <fengli@smartx.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  file-posix: check the use_lock before setting the file lock

The scenario is that when accessing a volume on an NFS filesystem
without supporting the file lock,  Qemu will complain "Failed to lock
byte 100", even when setting the file.locking = off.

We should do file lock related operations only when the file.locking is
enabled, otherwise, the syscall of 'fcntl' will return non-zero.

Signed-off-by: Li Feng <fengli@smartx.com>
Message-Id: <1607341446-85506-1-git-send-email-fengli@smartx.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: f0947dc694e57d6ecb0f5ac3d684bcce8952cdff
      
https://github.com/qemu/qemu/commit/f0947dc694e57d6ecb0f5ac3d684bcce8952cdff
  Author: Max Reitz <mreitz@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M tests/qemu-iotests/221
    M tests/qemu-iotests/221.out

  Log Message:
  -----------
  iotests/221: Discard image before qemu-img map

See the new comment for why this should be done.

I do not have a reproducer on master, but when using FUSE block exports,
this test breaks depending on the underlying filesystem (for me, it
works on tmpfs, but fails on xfs, because the block allocated by
file-posix has 16 kB there instead of 4 kB).

Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201207152245.66987-1-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 7cc25f6c9ba1622c0e2c1186bb47fca8de03672b
      
https://github.com/qemu/qemu/commit/7cc25f6c9ba1622c0e2c1186bb47fca8de03672b
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M net/can/can_host.c

  Log Message:
  -----------
  can-host: Fix crash when 'canbus' property is not set

Providing the 'if' property, but not 'canbus' segfaults like this:

 #0  0x0000555555b0f14d in can_bus_insert_client (bus=0x0, 
client=0x555556aa9af0) at ../net/can/can_core.c:88
 #1  0x00005555559c3803 in can_host_connect (ch=0x555556aa9ac0, 
errp=0x7fffffffd568) at ../net/can/can_host.c:62
 #2  0x00005555559c386a in can_host_complete (uc=0x555556aa9ac0, 
errp=0x7fffffffd568) at ../net/can/can_host.c:72
 #3  0x0000555555d52de9 in user_creatable_complete (uc=0x555556aa9ac0, 
errp=0x7fffffffd5c8) at ../qom/object_interfaces.c:23

Add the missing NULL check.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201130105615.21799-5-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 9b100af30f175bffe1fc44c3577ba42e8c170864
      
https://github.com/qemu/qemu/commit/9b100af30f175bffe1fc44c3577ba42e8c170864
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  block/file-posix: fix workaround in raw_do_pwrite_zeroes()

We should not set overlap_bytes:

1. Don't worry: it is calculated by bdrv_mark_request_serialising() and
   will be equal to or greater than bytes anyway.

2. If the request was already aligned up to some greater alignment,
   than we may break things: we reduce overlap_bytes, and further
   bdrv_mark_request_serialising() may not help, as it will not restore
   old bigger alignment.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20201203222713.13507-2-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 33985614bdbb302049e3dbc13580404b04cc4131
      
https://github.com/qemu/qemu/commit/33985614bdbb302049e3dbc13580404b04cc4131
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block/io: bdrv_refresh_limits(): use ERRP_GUARD

This simplifies following commit.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20201203222713.13507-3-vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: f4dad307ef844af097377c77dfb8049cc4b0b8d3
      
https://github.com/qemu/qemu/commit/f4dad307ef844af097377c77dfb8049cc4b0b8d3
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block/io: bdrv_check_byte_request(): drop bdrv_is_inserted()

Move bdrv_is_inserted() calls into callers.

We are going to make bdrv_check_byte_request() a clean thing.
bdrv_is_inserted() is not about checking the request, it's about
checking the bs. So, it should be separate.

With this patch we probably change error path for some failure
scenarios. But depending on the fact that querying too big request on
empty cdrom (or corrupted qcow2 node with no drv) will result in EIO
and not ENOMEDIUM would be very strange. More over, we are going to
move to 64bit requests, so larger requests will be allowed anyway.

More over, keeping in mind that cdrom is the only driver that has
.bdrv_is_inserted() handler it's strange that we should care so much
about it in generic block layer, intuitively we should just do read and
write, and cdrom driver should return correct errors if it is not
inserted. But it's a work for another series.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20201203222713.13507-4-vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 8b1170012b1de6649c66ac1887f4df7e312abf3b
      
https://github.com/qemu/qemu/commit/8b1170012b1de6649c66ac1887f4df7e312abf3b
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block.c
    M block/file-posix.c
    M block/io.c
    M include/block/block.h
    M include/block/block_int.h
    M tests/qemu-iotests/206
    M tests/qemu-iotests/206.out
    M tests/test-write-threshold.c

  Log Message:
  -----------
  block: introduce BDRV_MAX_LENGTH

We are going to modify block layer to work with 64bit requests. And
first step is moving to int64_t type for both offset and bytes
arguments in all block request related functions.

It's mostly safe (when widening signed or unsigned int to int64_t), but
switching from uint64_t is questionable.

So, let's first establish the set of requests we want to work with.
First signed int64_t should be enough, as off_t is signed anyway. Then,
obviously offset + bytes should not overflow.

And most interesting: (offset + bytes) being aligned up should not
overflow as well. Aligned to what alignment? First thing that comes in
mind is bs->bl.request_alignment, as we align up request to this
alignment. But there is another thing: look at
bdrv_mark_request_serialising(). It aligns request up to some given
alignment. And this parameter may be bdrv_get_cluster_size(), which is
often a lot greater than bs->bl.request_alignment.
Note also, that bdrv_mark_request_serialising() uses signed int64_t for
calculations. So, actually, we already depend on some restrictions.

Happily, bdrv_get_cluster_size() returns int and
bs->bl.request_alignment has 32bit unsigned type, but defined to be a
power of 2 less than INT_MAX. So, we may establish, that INT_MAX is
absolute maximum for any kind of alignment that may occur with the
request.

Note, that bdrv_get_cluster_size() is not documented to return power
of 2, still bdrv_mark_request_serialising() behaves like it is.
Also, backup uses bdi.cluster_size and is not prepared to it not being
power of 2.
So, let's establish that Qemu supports only power-of-2 clusters and
alignments.

So, alignment can't be greater than 2^30.

Finally to be safe with calculations, to not calculate different
maximums for different nodes (depending on cluster size and
request_alignment), let's simply set QEMU_ALIGN_DOWN(INT64_MAX, 2^30)
as absolute maximum bytes length for Qemu. Actually, it's not much less
than INT64_MAX.

OK, then, let's apply it to block/io.

Let's consider all block/io entry points of offset/bytes:

4 bytes/offset interface functions: bdrv_co_preadv_part(),
bdrv_co_pwritev_part(), bdrv_co_copy_range_internal() and
bdrv_co_pdiscard() and we check them all with bdrv_check_request().

We also have one entry point with only offset: bdrv_co_truncate().
Check the offset.

And one public structure: BdrvTrackedRequest. Happily, it has only
three external users:

 file-posix.c: adopted by this patch
 write-threshold.c: only read fields
 test-write-threshold.c: sets obviously small constant values

Better is to make the structure private and add corresponding
interfaces.. Still it's not obvious what kind of interface is needed
for file-posix.c. Let's keep it public but add corresponding
assertions.

After this patch we'll convert functions in block/io.c to int64_t bytes
and offset parameters. We can assume that offset/bytes pair always
satisfy new restrictions, and make
corresponding assertions where needed. If we reach some offset/bytes
point in block/io.c missing bdrv_check_request() it is considered a
bug. As well, if block/io.c modifies a offset/bytes request, expanding
it more then aligning up to request_alignment, it's a bug too.

For all io requests except for discard we keep for now old restriction
of 32bit request length.

iotest 206 output error message changed, as now test disk size is
larger than new limit. Add one more test case with new maximum disk
size to cover too-big-L1 case.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20201203222713.13507-5-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: d9dbf25f9624aac43e4357019bed4422f0b3368d
      
https://github.com/qemu/qemu/commit/d9dbf25f9624aac43e4357019bed4422f0b3368d
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  block: Simplify qmp_block_resize() error paths

The only thing that happens after the 'out:' label is blk_unref(blk).
However, blk = NULL in all of the error cases, so instead of jumping to
'out:', we can just return directly.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201203172311.68232-2-kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 8089eab2bd5fb160b038e64e14cf7ffb3f37091e
      
https://github.com/qemu/qemu/commit/8089eab2bd5fb160b038e64e14cf7ffb3f37091e
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  block: Fix locking in qmp_block_resize()

The drain functions assume that we hold the AioContext lock of the
drained block node. Make sure to actually take the lock.

Cc: qemu-stable@nongnu.org
Fixes: eb94b81a94bce112e6b206df846c1551aaf6cab6
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201203172311.68232-3-kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 960d5fb3e8ee09bc5f1a5c84f66dce42a6cef920
      
https://github.com/qemu/qemu/commit/960d5fb3e8ee09bc5f1a5c84f66dce42a6cef920
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

  Changed paths:
    M block/io.c

  Log Message:
  -----------
  block: Fix deadlock in bdrv_co_yield_to_drain()

If bdrv_co_yield_to_drain() is called for draining a block node that
runs in a different AioContext, it keeps that AioContext locked while it
yields and schedules a BH in the AioContext to do the actual drain.

As long as executing the BH is the very next thing that the event loop
of the node's AioContext does, this actually happens to work, but when
it tries to execute something else that wants to take the AioContext
lock, it will deadlock. (In the bug report, this other thing is a
virtio-scsi device running virtio_scsi_data_plane_handle_cmd().)

Instead, always drop the AioContext lock across the yield and reacquire
it only when the coroutine is reentered. The BH needs to unconditionally
take the lock for itself now.

This fixes the 'block_resize' QMP command on a block node that runs in
an iothread.

Cc: qemu-stable@nongnu.org
Fixes: eb94b81a94bce112e6b206df846c1551aaf6cab6
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1903511
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201203172311.68232-4-kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: ad717e6da3852b5729217d7938eecdb81c546114
      
https://github.com/qemu/qemu/commit/ad717e6da3852b5729217d7938eecdb81c546114
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-12-12 (Sat, 12 Dec 2020)

  Changed paths:
    M MAINTAINERS
    M block.c
    M block/accounting.c
    M block/curl.c
    M block/export/export.c
    A block/export/fuse.c
    M block/export/meson.build
    M block/file-posix.c
    M block/io.c
    M block/iscsi.c
    M block/throttle-groups.c
    M blockdev.c
    M configure
    M include/block/block.h
    M include/block/block_int.h
    A include/block/fuse.h
    M meson.build
    M meson_options.txt
    M net/can/can_host.c
    M qapi/block-export.json
    M storage-daemon/qemu-storage-daemon.c
    M tests/qemu-iotests/025
    M tests/qemu-iotests/026
    M tests/qemu-iotests/028
    M tests/qemu-iotests/028.out
    M tests/qemu-iotests/031
    M tests/qemu-iotests/034
    M tests/qemu-iotests/036
    M tests/qemu-iotests/037
    M tests/qemu-iotests/038
    M tests/qemu-iotests/039
    M tests/qemu-iotests/046
    M tests/qemu-iotests/046.out
    M tests/qemu-iotests/050
    M tests/qemu-iotests/054
    M tests/qemu-iotests/060
    M tests/qemu-iotests/071
    M tests/qemu-iotests/079
    M tests/qemu-iotests/080
    M tests/qemu-iotests/089
    M tests/qemu-iotests/089.out
    M tests/qemu-iotests/090
    M tests/qemu-iotests/091
    M tests/qemu-iotests/095
    M tests/qemu-iotests/097
    M tests/qemu-iotests/098
    M tests/qemu-iotests/102
    M tests/qemu-iotests/103
    M tests/qemu-iotests/106
    M tests/qemu-iotests/107
    M tests/qemu-iotests/108
    M tests/qemu-iotests/111
    M tests/qemu-iotests/112
    M tests/qemu-iotests/115
    M tests/qemu-iotests/117
    M tests/qemu-iotests/120
    M tests/qemu-iotests/121
    M tests/qemu-iotests/127
    M tests/qemu-iotests/133
    M tests/qemu-iotests/137
    M tests/qemu-iotests/138
    M tests/qemu-iotests/140
    M tests/qemu-iotests/154
    M tests/qemu-iotests/161
    M tests/qemu-iotests/171
    M tests/qemu-iotests/174
    M tests/qemu-iotests/175
    M tests/qemu-iotests/176
    M tests/qemu-iotests/177
    M tests/qemu-iotests/179
    M tests/qemu-iotests/183
    M tests/qemu-iotests/186
    M tests/qemu-iotests/187
    M tests/qemu-iotests/191
    M tests/qemu-iotests/195
    M tests/qemu-iotests/200
    M tests/qemu-iotests/200.out
    M tests/qemu-iotests/204
    M tests/qemu-iotests/206
    M tests/qemu-iotests/206.out
    M tests/qemu-iotests/214
    M tests/qemu-iotests/217
    M tests/qemu-iotests/220
    M tests/qemu-iotests/221
    M tests/qemu-iotests/221.out
    M tests/qemu-iotests/229
    M tests/qemu-iotests/229.out
    M tests/qemu-iotests/242
    M tests/qemu-iotests/247
    M tests/qemu-iotests/249
    M tests/qemu-iotests/250
    M tests/qemu-iotests/252
    M tests/qemu-iotests/265
    M tests/qemu-iotests/268
    M tests/qemu-iotests/272
    M tests/qemu-iotests/273
    M tests/qemu-iotests/279
    M tests/qemu-iotests/286
    M tests/qemu-iotests/287
    M tests/qemu-iotests/289
    M tests/qemu-iotests/290
    M tests/qemu-iotests/291
    M tests/qemu-iotests/292
    M tests/qemu-iotests/293
    M tests/qemu-iotests/294
    M tests/qemu-iotests/305
    A tests/qemu-iotests/308
    A tests/qemu-iotests/308.out
    M tests/qemu-iotests/check
    M tests/qemu-iotests/common.filter
    M tests/qemu-iotests/common.rc
    M tests/qemu-iotests/group
    M tests/test-write-threshold.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- Support for FUSE exports
- Fix deadlock in bdrv_co_yield_to_drain()
- Use lock guard macros
- Some preparational patches for 64 bit block layer
- file-posix: Fix request extension to INT64_MAX in raw_do_pwrite_zeroes()

# gpg: Signature made Fri 11 Dec 2020 17:06:19 GMT
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream: (34 commits)
  block: Fix deadlock in bdrv_co_yield_to_drain()
  block: Fix locking in qmp_block_resize()
  block: Simplify qmp_block_resize() error paths
  block: introduce BDRV_MAX_LENGTH
  block/io: bdrv_check_byte_request(): drop bdrv_is_inserted()
  block/io: bdrv_refresh_limits(): use ERRP_GUARD
  block/file-posix: fix workaround in raw_do_pwrite_zeroes()
  can-host: Fix crash when 'canbus' property is not set
  iotests/221: Discard image before qemu-img map
  file-posix: check the use_lock before setting the file lock
  iotests/308: Add test for FUSE exports
  iotests: Enable fuse for many tests
  iotests: Allow testing FUSE exports
  iotests: Give access to the qemu-storage-daemon
  storage-daemon: Call bdrv_close_all() on exit
  iotests/287: Clean up subshell test image
  iotests: Let _make_test_img guess $TEST_IMG_FILE
  iotests: Restrict some Python tests to file
  iotests/091: Use _cleanup_qemu instad of "wait"
  iotests: Derive image names from $TEST_IMG
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/a4b307b0eaf4...ad717e6da385



reply via email to

[Prev in Thread] Current Thread [Next in Thread]