qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] fa8fc1: block_int: make bdrv_backing_overridd


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] fa8fc1: block_int: make bdrv_backing_overridden static
Date: Fri, 14 Jan 2022 08:01:59 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: fa8fc1d09f9b4deaf764420ac11d8b3c88f8af60
      
https://github.com/qemu/qemu/commit/fa8fc1d09f9b4deaf764420ac11d8b3c88f8af60
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M block.c
    M include/block/block_int.h

  Log Message:
  -----------
  block_int: make bdrv_backing_overridden static

bdrv_backing_overridden is only used in block.c, so there is
no need to leave it in block_int.h

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20211215121140.456939-2-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: cc67f28ea2760505a4cc6efdc36cbb9b8421f928
      
https://github.com/qemu/qemu/commit/cc67f28ea2760505a4cc6efdc36cbb9b8421f928
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M block/monitor/block-hmp-cmds.c
    M blockdev.c
    M include/sysemu/blockdev.h
    M softmmu/vl.c

  Log Message:
  -----------
  include/sysemu/blockdev.h: remove drive_mark_claimed_by_board and inline 
drive_def

drive_def is only a particular use case of
qemu_opts_parse_noisily, so it can be inlined.

Also remove drive_mark_claimed_by_board, as it is only defined
but not implemented (nor used) anywhere.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20211215121140.456939-3-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: eac32e2232f949c0a1638acbef8f6ba0e4feeb67
      
https://github.com/qemu/qemu/commit/eac32e2232f949c0a1638acbef8f6ba0e4feeb67
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M blockdev.c
    M include/sysemu/blockdev.h

  Log Message:
  -----------
  include/sysemu/blockdev.h: remove drive_get_max_devs

Remove drive_get_max_devs, as it is not used by anyone.

Last use was removed in commit 8f2d75e81d5
("hw: Drop superfluous special checks for orphaned -drive").

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20211215121140.456939-4-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 64b4529a432507ee84a924be69a03432639e87ba
      
https://github.com/qemu/qemu/commit/64b4529a432507ee84a924be69a03432639e87ba
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M qapi/qdev.json
    M softmmu/vl.c
    M tests/qtest/device-plug-test.c

  Log Message:
  -----------
  softmmu: fix device deletion events with -device JSON syntax

The -device JSON syntax impl leaks a reference on the created
DeviceState instance. As a result when you hot-unplug the
device, the device_finalize method won't be called and thus
it will fail to emit the required DEVICE_DELETED event.

A 'json-cli' feature was previously added against the
'device_add' QMP command QAPI schema to indicated to mgmt
apps that -device supported JSON syntax. Given the hotplug
bug that feature flag is not usable for its purpose, so
we add a new 'json-cli-hotplug' feature to indicate the
-device supports JSON without breaking hotplug.

Fixes: 5dacda5167560b3af8eadbce5814f60ba44b467e
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/802
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220105123847.4047954-2-berrange@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Tested-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 9bd11f9638cbc08dcab6777f0a27f597cb44c22a
      
https://github.com/qemu/qemu/commit/9bd11f9638cbc08dcab6777f0a27f597cb44c22a
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M docs/tools/qemu-storage-daemon.rst

  Log Message:
  -----------
  docs: Correct 'vhost-user-blk' spelling

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220107105420.395011-2-f4bug@amsat.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c8cbc9524269d9583749aaaea8aa244add7e1900
      
https://github.com/qemu/qemu/commit/c8cbc9524269d9583749aaaea8aa244add7e1900
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

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

  Log Message:
  -----------
  qemu-storage-daemon: Add vhost-user-blk help

Add missing vhost-user-blk help:

  $ qemu-storage-daemon -h
  ...
    --export [type=]vhost-user-blk,id=<id>,node-name=<node-name>,
             addr.type=unix,addr.path=<socket-path>[,writable=on|off]
             [,logical-block-size=<block-size>][,num-queues=<num-queues>]
                           export the specified block node as a
                           vhosts-user-blk device over UNIX domain socket
    --export [type=]vhost-user-blk,id=<id>,node-name=<node-name>,
             fd,addr.str=<fd>[,writable=on|off]
             [,logical-block-size=<block-size>][,num-queues=<num-queues>]
                           export the specified block node as a
                           vhosts-user-blk device over file descriptor
  ...

Fixes: 90fc91d50b7 ("convert vhost-user-blk server to block export API")
Reported-by: Qing Wang <qinwang@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220107105420.395011-3-f4bug@amsat.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: bb01ea7311004b4a87b510446be689afb7f040ee
      
https://github.com/qemu/qemu/commit/bb01ea7311004b4a87b510446be689afb7f040ee
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M qapi/block-export.json

  Log Message:
  -----------
  qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER

When building QEMU with --disable-vhost-user and using introspection,
query-qmp-schema lists vhost-user-blk even though it's not actually
available:

  { "execute": "query-qmp-schema" }
  {
      "return": [
          ...
          {
              "name": "312",
              "members": [
                  {
                      "name": "nbd"
                  },
                  {
                      "name": "vhost-user-blk"
                  }
              ],
              "meta-type": "enum",
              "values": [
                  "nbd",
                  "vhost-user-blk"
              ]
          },

Restrict vhost-user-blk in BlockExportType when
CONFIG_VHOST_USER_BLK_SERVER is disabled, so it
doesn't end listed by query-qmp-schema.

Fixes: 90fc91d50b7 ("convert vhost-user-blk server to block export API")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220107105420.395011-4-f4bug@amsat.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 1e3552dbd28359d35967b7c28dc86cde1bc29205
      
https://github.com/qemu/qemu/commit/1e3552dbd28359d35967b7c28dc86cde1bc29205
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M block/block-backend.c

  Log Message:
  -----------
  block-backend: prevent dangling BDS pointers across aio_poll()

The BlockBackend root child can change when aio_poll() is invoked. This
happens when a temporary filter node is removed upon blockjob
completion, for example.

Functions in block/block-backend.c must be aware of this when using a
blk_bs() pointer across aio_poll() because the BlockDriverState refcnt
may reach 0, resulting in a stale pointer.

One example is scsi_device_purge_requests(), which calls blk_drain() to
wait for in-flight requests to cancel. If the backup blockjob is active,
then the BlockBackend root child is a temporary filter BDS owned by the
blockjob. The blockjob can complete during bdrv_drained_begin() and the
last reference to the BDS is released when the temporary filter node is
removed. This results in a use-after-free when blk_drain() calls
bdrv_drained_end(bs) on the dangling pointer.

Explicitly hold a reference to bs across block APIs that invoke
aio_poll().

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2021778
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2036178
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220111153613.25453-2-stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 2ca1d5d6b91f8a52a5c651f660b2f58c94bf97ba
      
https://github.com/qemu/qemu/commit/2ca1d5d6b91f8a52a5c651f660b2f58c94bf97ba
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    A tests/qemu-iotests/tests/stream-error-on-reset
    A tests/qemu-iotests/tests/stream-error-on-reset.out

  Log Message:
  -----------
  iotests/stream-error-on-reset: New test

Test the following scenario:
- Simple stream block in two-layer backing chain (base and top)
- The job is drained via blk_drain(), then an error occurs while the job
  settles the ongoing request
- And so the job completes while in blk_drain()

This was reported as a segfault, but is fixed by "block-backend: prevent
dangling BDS pointers across aio_poll()".

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2036178
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220111153613.25453-3-stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: e2eec2819a96f3a5d68f899c836ad365468cec01
      
https://github.com/qemu/qemu/commit/e2eec2819a96f3a5d68f899c836ad365468cec01
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

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

  Log Message:
  -----------
  iotests/308: Fix for CAP_DAC_OVERRIDE

With CAP_DAC_OVERRIDE (which e.g. root generally has), permission checks
will be bypassed when opening files.

308 in one instance tries to open a read-only file (FUSE export) with
qemu-io as read/write, and expects this to fail.  However, when running
it as root, opening will succeed (thanks to CAP_DAC_OVERRIDE) and only
the actual write operation will fail.

Note this as "Case not run", but have the test pass in either case.

Reported-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Fixes: 2c7dd057aa7bd7a875e9b1a53975c220d6380bc4
       ("export/fuse: Pass default_permissions for mount")
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220103120014.13061-1-hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 2db9b9e96f0b57ceaa49666d9b8a573290114fdf
      
https://github.com/qemu/qemu/commit/2db9b9e96f0b57ceaa49666d9b8a573290114fdf
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M block/vvfat.c

  Log Message:
  -----------
  vvfat: Fix size of temporary qcow file

The size of the qcow size was calculated so that only the FAT partition
would fit on it, but not the whole disk. However, offsets relative to
the whole disk are used to access it, so increase its size to be large
enough for that.

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


  Commit: b9b8860d24676ec59c878d5206ea6bcfc87af798
      
https://github.com/qemu/qemu/commit/b9b8860d24676ec59c878d5206ea6bcfc87af798
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M block/vvfat.c

  Log Message:
  -----------
  vvfat: Fix vvfat_write() for writes before the root directory

The calculation in sector2cluster() is done relative to the offset of
the root directory. Any writes to blocks before the start of the root
directory (in particular, writes to the FAT) result in negative values,
which are not handled correctly in vvfat_write().

This changes sector2cluster() to return a signed value, and makes sure
that vvfat_write() doesn't try to find mappings for negative cluster
number. It clarifies the code in vvfat_write() to make it more obvious
that the cluster numbers can be negative.

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


  Commit: 51cd8bddd63540514d44808f7920811439baa253
      
https://github.com/qemu/qemu/commit/51cd8bddd63540514d44808f7920811439baa253
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

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

  Log Message:
  -----------
  iotests: Test qemu-img convert of zeroed data cluster

This demonstrates what happens when the block status changes in
sub-min_sparse granularity, but all of the parts are zeroed out. The
alignment logic in is_allocated_sectors() prevents that the target image
remains fully sparse as expected, but turns it into a data cluster of
explicit zeros.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211217164654.1184218-2-vsementsov@virtuozzo.com>
Tested-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 96054c76ff2db74165385a69f234c57a6bbc941e
      
https://github.com/qemu/qemu/commit/96054c76ff2db74165385a69f234c57a6bbc941e
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M qemu-img.c
    M tests/qemu-iotests/122.out

  Log Message:
  -----------
  qemu-img: make is_allocated_sectors() more efficient

Consider the case when the whole buffer is zero and end is unaligned.

If i <= tail, we return 1 and do one unaligned WRITE, RMW happens.

If i > tail, we do on aligned WRITE_ZERO (or skip if target is zeroed)
and again one unaligned WRITE, RMW happens.

Let's do better: don't fragment the whole-zero buffer and report it as
ZERO: in case of zeroed target we just do nothing and avoid RMW. If
target is not zeroes, one unaligned WRITE_ZERO should not be much worse
than one unaligned WRITE.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211217164654.1184218-3-vsementsov@virtuozzo.com>
Tested-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 64631f368115a332bdca32553a430568ecc7761d
      
https://github.com/qemu/qemu/commit/64631f368115a332bdca32553a430568ecc7761d
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M block.c
    M block/commit.c
    M block/mirror.c
    M hw/block/block.c
    M include/block/block.h
    M qapi/block-core.json
    M scripts/render_block_graph.py
    M tests/qemu-iotests/273.out

  Log Message:
  -----------
  block: drop BLK_PERM_GRAPH_MOD

First, this permission never protected a node from being changed, as
generic child-replacing functions don't check it.

Second, it's a strange thing: it presents a permission of parent node
to change its child. But generally, children are replaced by different
mechanisms, like jobs or qmp commands, not by nodes.

Graph-mod permission is hard to understand. All other permissions
describe operations which done by parent node on its child: read,
write, resize. Graph modification operations are something completely
different.

The only place where BLK_PERM_GRAPH_MOD is used as "perm" (not shared
perm) is mirror_start_job, for s->target. Still modern code should use
bdrv_freeze_backing_chain() to protect from graph modification, if we
don't do it somewhere it may be considered as a bug. So, it's a bit
risky to drop GRAPH_MOD, and analyzing of possible loss of protection
is hard. But one day we should do it, let's do it now.

One more bit of information is that locking the corresponding byte in
file-posix doesn't make sense at all.

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


  Commit: e5e748739562268ef4063ee77bf53ad7040b25c7
      
https://github.com/qemu/qemu/commit/e5e748739562268ef4063ee77bf53ad7040b25c7
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M tests/qemu-iotests/testrunner.py

  Log Message:
  -----------
  iotests/testrunner.py: refactor test_field_width

A lot of Optional[] types doesn't make code beautiful.
test_field_width defaults to 8, but that is never used in the code.

More over, if we want some default behavior for single call of
test_run(), it should just print the whole test name, not limiting or
expanding its width, so 8 is bad default.

So, just drop the default as unused for now.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211210201450.101576-1-vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 1cd2ad11d37c48f284f557954e1df675b126264c
      
https://github.com/qemu/qemu/commit/1cd2ad11d37c48f284f557954e1df675b126264c
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-01-14 (Fri, 14 Jan 2022)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/commit.c
    M block/mirror.c
    M block/monitor/block-hmp-cmds.c
    M block/vvfat.c
    M blockdev.c
    M docs/tools/qemu-storage-daemon.rst
    M hw/block/block.c
    M include/block/block.h
    M include/block/block_int.h
    M include/sysemu/blockdev.h
    M qapi/block-core.json
    M qapi/block-export.json
    M qapi/qdev.json
    M qemu-img.c
    M scripts/render_block_graph.py
    M softmmu/vl.c
    M storage-daemon/qemu-storage-daemon.c
    M tests/qemu-iotests/122
    M tests/qemu-iotests/122.out
    M tests/qemu-iotests/273.out
    M tests/qemu-iotests/308
    M tests/qemu-iotests/308.out
    M tests/qemu-iotests/testrunner.py
    A tests/qemu-iotests/tests/stream-error-on-reset
    A tests/qemu-iotests/tests/stream-error-on-reset.out
    M tests/qtest/device-plug-test.c

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

Block layer patches

- qemu-storage-daemon: Add vhost-user-blk help
- block-backend: Fix use-after-free for BDS pointers after aio_poll()
- qemu-img: Fix sparseness of output image with unaligned ranges
- vvfat: Fix crashes in read-write mode
- Fix device deletion events with -device JSON syntax
- Code cleanups

# gpg: Signature made Fri 14 Jan 2022 13:50:16 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:
  iotests/testrunner.py: refactor test_field_width
  block: drop BLK_PERM_GRAPH_MOD
  qemu-img: make is_allocated_sectors() more efficient
  iotests: Test qemu-img convert of zeroed data cluster
  vvfat: Fix vvfat_write() for writes before the root directory
  vvfat: Fix size of temporary qcow file
  iotests/308: Fix for CAP_DAC_OVERRIDE
  iotests/stream-error-on-reset: New test
  block-backend: prevent dangling BDS pointers across aio_poll()
  qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER
  qemu-storage-daemon: Add vhost-user-blk help
  docs: Correct 'vhost-user-blk' spelling
  softmmu: fix device deletion events with -device JSON syntax
  include/sysemu/blockdev.h: remove drive_get_max_devs
  include/sysemu/blockdev.h: remove drive_mark_claimed_by_board and inline 
drive_def
  block_int: make bdrv_backing_overridden static

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


Compare: https://github.com/qemu/qemu/compare/0b3f07ebf295...1cd2ad11d37c



reply via email to

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