qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 724e67: tests/qemu-iotests/312: Mark "quorum"


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 724e67: tests/qemu-iotests/312: Mark "quorum" as required ...
Date: Fri, 03 Feb 2023 04:48:41 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 724e6703b1823d34e485bc710dcff586c5ce120d
      
https://github.com/qemu/qemu/commit/724e6703b1823d34e485bc710dcff586c5ce120d
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M tests/qemu-iotests/312

  Log Message:
  -----------
  tests/qemu-iotests/312: Mark "quorum" as required driver

"quorum" is required by iotest 312 - if it is not compiled into the
QEMU binary, the test fails. Thus list "quorum" as required driver
so that the test gets skipped in case it is not available.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230104114601.269351-1-thuth@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 95988739c73f76176327061824c603f85b072ff2
      
https://github.com/qemu/qemu/commit/95988739c73f76176327061824c603f85b072ff2
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M tests/qemu-iotests/262

  Log Message:
  -----------
  tests/qemu-iotests/262: Check for availability of "blkverify" first

In downstream RHEL builds, we do not have "blkverify" enabled, so
iotest 262 is currently failing there. Thus let's list "blkverify"
as required item so that the test properly gets skipped instead if
"blkverify" is missing.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230104112850.261480-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: a4b15a8b9ef25b44fa92a4825312622600c1f37c
      
https://github.com/qemu/qemu/commit/a4b15a8b9ef25b44fa92a4825312622600c1f37c
  Author: Xiang Zheng <zhengxiang9@huawei.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M hw/block/block.c

  Log Message:
  -----------
  pflash: Only read non-zero parts of backend image

Currently we fill the VIRT_FLASH memory space with two 64MB NOR images
when using persistent UEFI variables on virt board. Actually we only use
a very small(non-zero) part of the memory while the rest significant
large(zero) part of memory is wasted.

So this patch checks the block status and only writes the non-zero part
into memory. This requires pflash devices to use sparse files for
backends.

Signed-off-by: Xiang Zheng <zhengxiang9@huawei.com>

[ kraxel: rebased to latest master ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20221220084246.1984871-1-kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: cbdbc47cee539ed1ef3e9a27adc47e26d1f921c6
      
https://github.com/qemu/qemu/commit/cbdbc47cee539ed1ef3e9a27adc47e26d1f921c6
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M include/qemu/osdep.h

  Log Message:
  -----------
  coroutine: annotate coroutine_fn for libclang

Clang has a generic __annotate__ attribute that can be used by
static analyzers to understand properties of functions and
analyze the control flow.  Furthermore, unlike TSA annotations, the
__annotate__ attribute applies to function pointers as well.

As a first step towards static analysis of coroutine_fn markers,
attach the attribute to the marker when compiling with clang.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20221216110758.559947-2-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 0f3de970febd2c9b29dccecb63ca928c6802a101
      
https://github.com/qemu/qemu/commit/0f3de970febd2c9b29dccecb63ca928c6802a101
  Author: Alberto Faria <afaria@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M include/block/block-common.h
    M include/qemu/osdep.h

  Log Message:
  -----------
  block: Add no_coroutine_fn and coroutine_mixed_fn marker

Add more annotations to functions, describing valid and invalid
calls from coroutine to non-coroutine context.

When applied to a function, no_coroutine_fn advertises that it should
not be called from coroutine_fn functions.  This can be because the
function blocks or, in the case of generated_co_wrapper, to enforce
that coroutine_fn functions directly call the coroutine_fn that backs
the generated_co_wrapper.

coroutine_mixed_fn instead is for function that can be called in
both coroutine and non-coroutine context, but will suspend when
called in coroutine context.  Annotating them is a first step
towards enforcing that non-annotated functions are absolutely
not going to suspend.

These can be used for example with the vrc tool:

    # find functions that *really* cannot be called from no_coroutine_fn
    (vrc) load --loader clang 
libblock.fa.p/meson-generated_.._block_block-gen.c.o
    (vrc) paths [no_coroutine_fn,!coroutine_mixed_fn]
    bdrv_remove_persistent_dirty_bitmap
    bdrv_create
    bdrv_can_store_new_dirty_bitmap

    # find how coroutine_fns end up calling a mixed function
    (vrc) load --loader clang --force libblock.fa.p/*.c.o
    (vrc) paths [coroutine_fn] [!no_coroutine_fn]* [coroutine_mixed_fn]
    ...
    bdrv_pread <- vhdx_log_write <- vhdx_log_write_and_flush <- vhdx_co_writev
    ...

Signed-off-by: Alberto Faria <afaria@redhat.com>
[Rebase, add coroutine_mixed_fn. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20221216110758.559947-3-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 264dcbb2b1e5b66d7a5b08662b200c2b315dce0f
      
https://github.com/qemu/qemu/commit/264dcbb2b1e5b66d7a5b08662b200c2b315dce0f
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M qemu-io-cmds.c

  Log Message:
  -----------
  qemu-io: do not reinvent the blk_pwrite_zeroes wheel

qemu-io's do_co_pwrite_zeroes is reinventing the coroutine wrapper
blk_pwrite_zeroes.  Just use the real thing directly.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20221215130225.476477-1-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 3d65110f0cd453ac5a5a9c4211902271775eba75
      
https://github.com/qemu/qemu/commit/3d65110f0cd453ac5a5a9c4211902271775eba75
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M block.c
    M block/block-backend.c
    M include/block/block-io.h

  Log Message:
  -----------
  block: remove bdrv_coroutine_enter

It has only one caller---inline it and remove the function.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20221215130225.476477-2-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: b03dd9613bcf8fe948581b2b3585510cb525c382
      
https://github.com/qemu/qemu/commit/b03dd9613bcf8fe948581b2b3585510cb525c382
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M block/qcow2-bitmap.c

  Log Message:
  -----------
  qcow2: Fix theoretical corruption in store_bitmap() error path

In order to write the bitmap table to the image file, it is converted to
big endian. If the write fails, it is passed to clear_bitmap_table() to
free all of the clusters it had allocated before. However, if we don't
convert it back to native endianness first, we'll free things at a wrong
offset.

In practical terms, the offsets will be so high that we won't actually
free any allocated clusters, but just run into an error, but in theory
this can cause image corruption.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230112191454.169353-2-kwolf@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 44efba2d713aca076c411594d0c1a2b99155eeb3
      
https://github.com/qemu/qemu/commit/44efba2d713aca076c411594d0c1a2b99155eeb3
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img commit: Report errors while closing the image

blk_unref() can't report any errors that happen while closing the image.
For example, if qcow2 hits an -ENOSPC error while writing out dirty
bitmaps when it's closed, it prints error messages to stderr, but
'qemu-img commit' won't see any error return value and will therefore
look successful with exit code 0.

In order to fix this, manually inactivate the image first before calling
blk_unref(). This already performs the operations that would be most
likely to fail while closing the image, but it can still return errors.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230112191454.169353-3-kwolf@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c5e477110dcb8ef4642dce399777c3dee68fa96c
      
https://github.com/qemu/qemu/commit/c5e477110dcb8ef4642dce399777c3dee68fa96c
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img bitmap: Report errors while closing the image

blk_unref() can't report any errors that happen while closing the image.
For example, if qcow2 hits an -ENOSPC error while writing out dirty
bitmaps when it's closed, it prints error messages to stderr, but
'qemu-img bitmap' won't see any error return value and will therefore
look successful with exit code 0.

In order to fix this, manually inactivate the image first before calling
blk_unref(). This already performs the operations that would be most
likely to fail while closing the image, but it can still return errors.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1330
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230112191454.169353-4-kwolf@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 07a4e1f8e5418f36424cd57d5d061b090a238c65
      
https://github.com/qemu/qemu/commit/07a4e1f8e5418f36424cd57d5d061b090a238c65
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    A tests/qemu-iotests/tests/qemu-img-close-errors
    A tests/qemu-iotests/tests/qemu-img-close-errors.out

  Log Message:
  -----------
  qemu-iotests: Test qemu-img bitmap/commit exit code on error

This tests that when an error happens while writing back bitmaps to the
image file in qcow2_inactivate(), 'qemu-img bitmap/commit' actually
return an error value in their exit code instead of making the operation
look successful to scripts.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230112191454.169353-5-kwolf@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 5b317b8dd95fd5a051f5c84f5442c03fc67faae2
      
https://github.com/qemu/qemu/commit/5b317b8dd95fd5a051f5c84f5442c03fc67faae2
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M scripts/block-coroutine-wrapper.py

  Log Message:
  -----------
  block-coroutine-wrapper: support void functions

Just omit the various 'return' when the return type is void.

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


  Commit: 8f4974543203bd1e3a77f198ebb2c60d177b1c40
      
https://github.com/qemu/qemu/commit/8f4974543203bd1e3a77f198ebb2c60d177b1c40
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/block-backend.c
    M block/file-posix.c
    M block/io.c
    M block/nvme.c
    M include/block/block-io.h
    M include/block/block_int-common.h
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Convert bdrv_io_plug() to co_wrapper

BlockDriver->bdrv_io_plug is categorized as IO callback, and it
currently doesn't run in a coroutine. We should let it take a graph
rdlock since the callback traverses the block nodes graph, which however
is only possible in a coroutine.

The only caller of this function is blk_io_plug(), therefore make
blk_io_plug() a co_wrapper, so that we're always running in a coroutine
where the lock can be taken.

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


  Commit: 09d9fc97f8b0bf30f3c55a5ae3a20f799fd3e5f2
      
https://github.com/qemu/qemu/commit/09d9fc97f8b0bf30f3c55a5ae3a20f799fd3e5f2
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/blkio.c
    M block/block-backend.c
    M block/file-posix.c
    M block/io.c
    M block/nvme.c
    M include/block/block-io.h
    M include/block/block_int-common.h
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Convert bdrv_io_unplug() to co_wrapper

BlockDriver->bdrv_io_unplug is categorized as IO callback, and it
currently doesn't run in a coroutine. We should let it take a graph
rdlock since the callback traverses the block nodes graph, which however
is only possible in a coroutine.

The only caller of this function is blk_io_unplug(), therefore make
blk_io_unplug() a co_wrapper, so that we're always running in a
coroutine where the lock can be taken.

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


  Commit: 1e97be915697fff198e9922321066cf9b44ef4b9
      
https://github.com/qemu/qemu/commit/1e97be915697fff198e9922321066cf9b44ef4b9
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/file-posix.c
    M block/io.c
    M blockdev.c
    M include/block/block-io.h
    M include/block/block_int-common.h
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Convert bdrv_is_inserted() to co_wrapper

bdrv_is_inserted() is categorized as an I/O function, and it currently
doesn't run in a coroutine. We should let it take a graph rdlock since
it traverses the block nodes graph, which however is only possible in a
coroutine.

Therefore turn it into a co_wrapper to move the actual function into a
coroutine where the lock can be taken.

At the same time, add also blk_is_inserted as co_wrapper_mixed, since it
is called in both coroutine and non-coroutine contexts.

Because now this function creates a new coroutine and polls, we need to
take the AioContext lock where it is missing, for the only reason that
internally c_w_mixed_bdrv_rdlock calls AIO_WAIT_WHILE and it expects to
release the AioContext lock. Once the rwlock is ultimated and placed in
every place it needs to be, we will poll using AIO_WAIT_WHILE_UNLOCKED
and remove the AioContext lock.

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


  Commit: c057960c4e33becb22d4741156203a4b0d4a3088
      
https://github.com/qemu/qemu/commit/c057960c4e33becb22d4741156203a4b0d4a3088
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

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

  Log Message:
  -----------
  block: Rename refresh_total_sectors to bdrv_refresh_total_sectors

The name is not good, not the least because we are going to convert this
to a generated co_wrapper, which adds a _co infix after the first part
of the name.

No functional change intended.

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


  Commit: c86422c5549c0983b4b4525b8f56a1c69dd67aa1
      
https://github.com/qemu/qemu/commit/c86422c5549c0983b4b4525b8f56a1c69dd67aa1
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block.c
    M block/blkdebug.c
    M block/blkio.c
    M block/blklogwrites.c
    M block/blkreplay.c
    M block/blkverify.c
    M block/block-backend.c
    M block/commit.c
    M block/copy-on-read.c
    M block/crypto.c
    M block/curl.c
    M block/file-posix.c
    M block/file-win32.c
    M block/filter-compress.c
    M block/gluster.c
    M block/iscsi.c
    M block/meson.build
    M block/mirror.c
    M block/nbd.c
    M block/null.c
    M block/nvme.c
    M block/preallocate.c
    M block/qed.c
    M block/quorum.c
    M block/raw-format.c
    M block/rbd.c
    M block/replication.c
    M block/ssh.c
    M block/throttle.c
    M hw/scsi/scsi-disk.c
    M include/block/block-io.h
    M include/block/block_int-common.h
    M include/block/block_int-io.h
    M include/sysemu/block-backend-io.h
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  block: Convert bdrv_refresh_total_sectors() to co_wrapper_mixed

BlockDriver->bdrv_getlength is categorized as IO callback, and it
currently doesn't run in a coroutine. We should let it take a graph
rdlock since the callback traverses the block nodes graph, which however
is only possible in a coroutine.

Therefore turn it into a co_wrapper to move the actual function into a
coroutine where the lock can be taken.

Because now this function creates a new coroutine and polls, we need to
take the AioContext lock where it is missing, for the only reason that
internally co_wrapper calls AIO_WAIT_WHILE and it expects to release the
AioContext lock.

This is especially messy when a co_wrapper creates a coroutine and polls
in bdrv_open_driver, because this function has so many callers in so
many context that it can easily lead to deadlocks. Therefore the new
rule for bdrv_open_driver is that the caller must always hold the
AioContext lock of the given bs (except if it is a coroutine), because
the function calls bdrv_refresh_total_sectors() which is now a
co_wrapper.

Once the rwlock is ultimated and placed in every place it needs to be,
we will poll using AIO_WAIT_WHILE_UNLOCKED and remove the AioContext
lock.

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


  Commit: d886257d84dd7c3d3f04c3b1e2e4749b47541ee5
      
https://github.com/qemu/qemu/commit/d886257d84dd7c3d3f04c3b1e2e4749b47541ee5
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/block-backend.c

  Log Message:
  -----------
  block-backend: use bdrv_getlength instead of blk_getlength

The only difference is that blk_ checks if the block is available,
but this check is already performed above in blk_check_byte_request().

This is in preparation for the graph rdlock, which will be taken
by both the callers of blk_check_byte_request() and blk_getlength().

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


  Commit: bd53086e824397a7bf0e875eaa9b339cf8394d75
      
https://github.com/qemu/qemu/commit/bd53086e824397a7bf0e875eaa9b339cf8394d75
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/block-backend.c
    M block/io.c
    M block/preallocate.c
    M block/qed.c

  Log Message:
  -----------
  block: use bdrv_co_refresh_total_sectors when possible

In some places we are sure we are always running in a
coroutine, therefore it's useless to call the generated_co_wrapper,
instead call directly the _co_ function.

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


  Commit: 82618d7bc341cb93b9ce9c206d7ec84cebe83d00
      
https://github.com/qemu/qemu/commit/82618d7bc341cb93b9ce9c206d7ec84cebe83d00
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block.c
    M block/file-posix.c
    M block/file-win32.c
    M block/gluster.c
    M block/nfs.c
    M block/null.c
    M block/qcow2-refcount.c
    M block/vmdk.c
    M include/block/block-io.h
    M include/block/block_int-common.h

  Log Message:
  -----------
  block: Convert bdrv_get_allocated_file_size() to co_wrapper

bdrv_get_allocated_file_size() is categorized as an I/O function, and it
currently doesn't run in a coroutine. We should let it take a graph
rdlock since it traverses the block nodes graph, which however is only
possible in a coroutine.

Therefore turn it into a co_wrapper to move the actual function into a
coroutine where the lock can be taken.

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


  Commit: 3d47eb0a2a42b13734d1beb75c4310b3881f906f
      
https://github.com/qemu/qemu/commit/3d47eb0a2a42b13734d1beb75c4310b3881f906f
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block.c
    M block/blkio.c
    M block/crypto.c
    M block/file-posix.c
    M block/io.c
    M block/iscsi.c
    M block/mirror.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/raw-format.c
    M block/rbd.c
    M block/vdi.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M include/block/block-io.h
    M include/block/block_int-common.h

  Log Message:
  -----------
  block: Convert bdrv_get_info() to co_wrapper_mixed

bdrv_get_info() is categorized as an I/O function, and it currently
doesn't run in a coroutine. We should let it take a graph rdlock since
it traverses the block nodes graph, which however is only possible in a
coroutine.

Therefore turn it into a co_wrapper to move the actual function into a
coroutine where the lock can be taken.

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


  Commit: 2531b390fbf67ceccf63f7d236ab2a998f135624
      
https://github.com/qemu/qemu/commit/2531b390fbf67ceccf63f7d236ab2a998f135624
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/copy-on-read.c
    M block/file-posix.c
    M block/filter-compress.c
    M block/raw-format.c
    M include/block/block-io.h
    M include/block/block_int-common.h
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Convert bdrv_eject() to co_wrapper

bdrv_eject() is categorized as an I/O function, and it currently
doesn't run in a coroutine. We should let it take a graph rdlock since
it traverses the block nodes graph, which however is only possible in a
coroutine.

The only caller of this function is blk_eject(). Therefore make
blk_eject() a co_wrapper, so that it always creates a new coroutine, and
then make bdrv_eject() coroutine_fn where the lock can be taken.

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


  Commit: 2c75261cc2b5d1cdd6f012d7a3ccbc089f966dcb
      
https://github.com/qemu/qemu/commit/2c75261cc2b5d1cdd6f012d7a3ccbc089f966dcb
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/copy-on-read.c
    M block/file-posix.c
    M block/filter-compress.c
    M block/raw-format.c
    M include/block/block-io.h
    M include/block/block_int-common.h
    M include/sysemu/block-backend-io.h

  Log Message:
  -----------
  block: Convert bdrv_lock_medium() to co_wrapper

bdrv_lock_medium() is categorized as an I/O function, and it currently
doesn't run in a coroutine. We should let it take a graph rdlock since
it traverses the block nodes graph, which however is only possible in a
coroutine.

The only caller of this function is blk_lock_medium(). Therefore make
blk_lock_medium() a co_wrapper, so that it always creates a new
coroutine, and then make bdrv_lock_medium() a coroutine_fn where the
lock can be taken.

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


  Commit: c834dc05863e1254b379d73baeb04d24ced01e8c
      
https://github.com/qemu/qemu/commit/c834dc05863e1254b379d73baeb04d24ced01e8c
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block.c
    M block/blkdebug.c
    M block/io.c
    M include/block/block-io.h
    M include/block/block_int-common.h

  Log Message:
  -----------
  block: Convert bdrv_debug_event() to co_wrapper_mixed

bdrv_debug_event() is categorized as an I/O function, and it currently
doesn't run in a coroutine. We should let it take a graph rdlock since
it traverses the block nodes graph, which however is only possible in a
coroutine.

Therefore turn it into a co_wrapper_mixed to move the actual function
into a coroutine where the lock can be taken.

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


  Commit: ca5e2ad98d4475a5f938ad5b65cc10e819190bba
      
https://github.com/qemu/qemu/commit/ca5e2ad98d4475a5f938ad5b65cc10e819190bba
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/io.c
    M block/qcow2.c
    M include/block/block_int-common.h

  Log Message:
  -----------
  block: Rename bdrv_load/save_vmstate() to bdrv_co_load/save_vmstate()

Since these functions always run in coroutine context, adjust
their name to include "_co_", just like all other BlockDriver callbacks.

No functional change intended.

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


  Commit: fcb9e05144db51966e1476790129dbff92a0bea4
      
https://github.com/qemu/qemu/commit/fcb9e05144db51966e1476790129dbff92a0bea4
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M include/block/nbd.h

  Log Message:
  -----------
  block/nbd: Add missing <qemu/bswap.h> include

The inlined nbd_readXX() functions call beXX_to_cpu(), themselves
declared in <qemu/bswap.h>. This fixes when refactoring:

  In file included from ../../block/nbd.c:44:
  include/block/nbd.h: In function 'nbd_read16':
  include/block/nbd.h:383:12: error: implicit declaration of function 
'be16_to_cpu' [-Werror=implicit-function-declaration]
    383 |     *val = be##bits##_to_cpu(*val);                                   
  \
        |            ^~
  include/block/nbd.h:387:1: note: in expansion of macro 'DEF_NBD_READ_N'
    387 | DEF_NBD_READ_N(16) /* Defines nbd_read16(). */
        | ^~~~~~~~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221125175328.48539-1-philmd@linaro.org>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 3716470b24f0f63090d59bcf28ad8fe6fb7835bd
      
https://github.com/qemu/qemu/commit/3716470b24f0f63090d59bcf28ad8fe6fb7835bd
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/qapi.c
    M include/block/qapi.h
    M qemu-io-cmds.c

  Log Message:
  -----------
  block: Improve empty format-specific info dump

When a block driver supports obtaining format-specific information, but
that object only contains optional fields, it is possible that none of
them are present, so that dump_qobject() (called by
bdrv_image_info_specific_dump()) will not print anything.

The callers of bdrv_image_info_specific_dump() put a header above this
information ("Format specific information:\n"), which will look strange
when there is nothing below.  Modify bdrv_image_info_specific_dump() to
print this header instead of its callers, and only if there is indeed
something to be printed.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-2-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 7f36a50ab4e7d39369cac67be4ba9d6ee4081dc0
      
https://github.com/qemu/qemu/commit/7f36a50ab4e7d39369cac67be4ba9d6ee4081dc0
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/file-posix.c
    M qapi/block-core.json

  Log Message:
  -----------
  block/file: Add file-specific image info

Add some (optional) information that the file driver can provide for
image files, namely the extent size hint.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-3-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 456e75171a85c19a5bfa202eefcbdc4ef1692f05
      
https://github.com/qemu/qemu/commit/456e75171a85c19a5bfa202eefcbdc4ef1692f05
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/vmdk.c
    M qapi/block-core.json

  Log Message:
  -----------
  block/vmdk: Change extent info type

VMDK's implementation of .bdrv_get_specific_info() returns information
about its extent files, ostensibly in the form of ImageInfo objects.
However, it does not get this information through
bdrv_query_image_info(), but fills only a select few fields with custom
information that does not always match the fields' purposes.

For example, @format, which is supposed to be a block driver name, is
filled with the extent type, e.g. SPARSE or FLAT.

In ImageInfo, @compressed shows whether the data that can be seen in the
image is stored in compressed form or not.  For example, a compressed
qcow2 image will store compressed data in its data file, but when
accessing the qcow2 node, you will see normal data.  This is not how
VMDK uses the @compressed field for its extent files: Instead, it
signifies whether accessing the extent file will yield compressed data
(which the VMDK driver then (de-)compresses).

Create a new structure to represent the extent information.  This allows
us to clarify the fields' meanings, and it clearly shows that these are
not complete ImageInfo objects.  (That is, if a user wants an extent
file's ImageInfo object, they will need to query it separately, and will
not get it from ImageInfoSpecificVmdk.extents.)

Note that this removes the last use of ['ImageInfo'] (i.e. an array of
ImageInfo objects), so the QAPI generator will no longer generate
ImageInfoList by default.  However, we use it in qemu-img.c, so we need
to create a dummy object to force the generate to create that type,
similarly to DummyForceArrays in machine.json (introduced in commit
9f08c8ec73878122ad4b061ed334f0437afaaa32 ("qapi: Lazy creation of array
types")).

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-4-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: a2085f8909377b6df738f6c3f7ee6db4d16da8f7
      
https://github.com/qemu/qemu/commit/a2085f8909377b6df738f6c3f7ee6db4d16da8f7
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/qapi.c
    M include/block/qapi.h
    M qapi/block-core.json

  Log Message:
  -----------
  block: Split BlockNodeInfo off of ImageInfo

ImageInfo sometimes contains flat information, and sometimes it does
not.  Split off a BlockNodeInfo struct, which only contains information
about a single node and has no link to the backing image.

We do this so we can extend BlockNodeInfo to a BlockGraphInfo struct,
which has links to all child nodes, not just the backing node.  It would
be strange to base BlockGraphInfo on ImageInfo, because then this
extended struct would have two links to the backing node (one in
BlockGraphInfo as one of all the child links, and one in ImageInfo).

Furthermore, it is quite common to ignore the backing-image field
altogether: bdrv_query_image_info() does not set it, and
bdrv_image_info_dump() does not evaluate it.  That signals that we
should have different structs for describing a single node and one that
has a link to the backing image.

Still, bdrv_query_image_info() and bdrv_image_info_dump() are not
changed too much in this patch.  Follow-up patches will handle them.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-5-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: b1f4cd1589a16fec02f264a09bd3560e4ccce3c2
      
https://github.com/qemu/qemu/commit/b1f4cd1589a16fec02f264a09bd3560e4ccce3c2
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/monitor/block-hmp-cmds.c
    M block/qapi.c
    M include/block/qapi.h
    M qapi/block-core.json
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Use BlockNodeInfo

qemu-img info never uses ImageInfo's backing-image field, because it
opens the backing chain one by one with BDRV_O_NO_BACKING, and prints
all backing chain nodes' information consecutively.  Use BlockNodeInfo
to make it clear that we only print information about a single node, and
that we are not using the backing-image field.

Notably, bdrv_image_info_dump() does not evaluate the backing-image
field, so we can easily make it take a BlockNodeInfo pointer (and
consequentially rename it to bdrv_node_info_dump()).  It makes more
sense this way, because again, the interface now makes it syntactically
clear that backing-image is ignored by this function.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-6-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 5d8813593f3f673fc96eed199beb35690cc46f58
      
https://github.com/qemu/qemu/commit/5d8813593f3f673fc96eed199beb35690cc46f58
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

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

  Log Message:
  -----------
  block/qapi: Let bdrv_query_image_info() recurse

There is no real reason why bdrv_query_image_info() should generally not
recurse.  The ImageInfo struct has a pointer to the backing image, so it
should generally be filled, unless the caller explicitly opts out.

This moves the recursing code from bdrv_block_device_info() into
bdrv_query_image_info().

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-7-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 6cab33997b91eb86e82a6a2ae58a24f835249d4a
      
https://github.com/qemu/qemu/commit/6cab33997b91eb86e82a6a2ae58a24f835249d4a
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/qapi.c
    M include/block/qapi.h
    M qapi/block-core.json

  Log Message:
  -----------
  block/qapi: Introduce BlockGraphInfo

Introduce a new QAPI type BlockGraphInfo and an associated
bdrv_query_block_graph_info() function that recursively gathers
BlockNodeInfo objects through a block graph.

A follow-up patch is going to make "qemu-img info" use this to print
information about all nodes that are (usually implicitly) opened for a
given image file.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-8-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 76c9e9750d1bd580e8ed4465f6be3a986434e7c3
      
https://github.com/qemu/qemu/commit/76c9e9750d1bd580e8ed4465f6be3a986434e7c3
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/monitor/block-hmp-cmds.c
    M block/qapi.c
    M include/block/qapi.h
    M qemu-img.c
    M qemu-io-cmds.c

  Log Message:
  -----------
  block/qapi: Add indentation to bdrv_node_info_dump()

In order to let qemu-img info present a block graph, add a parameter to
bdrv_node_info_dump() and bdrv_image_info_specific_dump() so that the
information of nodes below the root level can be given an indentation.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-9-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: bcc6777ad6facede73c0cf8b1700045bf4365f7d
      
https://github.com/qemu/qemu/commit/bcc6777ad6facede73c0cf8b1700045bf4365f7d
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

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

  Log Message:
  -----------
  iotests: Filter child node information

Before we let qemu-img info print child node information, have
common.filter, common.rc, and iotests.py filter it from the test output
so we get as few reference output changes as possible.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-10-hreitz@redhat.com>
Tested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 74163adda3101b127943f7cbbf8fcccd2d472426
      
https://github.com/qemu/qemu/commit/74163adda3101b127943f7cbbf8fcccd2d472426
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M tests/qemu-iotests/106
    M tests/qemu-iotests/214
    M tests/qemu-iotests/308

  Log Message:
  -----------
  iotests/106, 214, 308: Read only one size line

These tests read size information (sometimes disk size, sometimes
virtual size) from qemu-img info's output.  Once qemu-img starts
printing info about child nodes, we are going to see multiple instances
of that per image, but these tests are only interested in the first one,
so use "head -n 1" to get it.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-11-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: c04d0ab026201d21873a63f768cb69c4554dfec1
      
https://github.com/qemu/qemu/commit/c04d0ab026201d21873a63f768cb69c4554dfec1
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M qapi/block-core.json
    M qemu-img.c
    M tests/qemu-iotests/065
    M tests/qemu-iotests/302.out

  Log Message:
  -----------
  qemu-img: Let info print block graph

For every node in the backing chain, collect its BlockGraphInfo struct
using bdrv_query_block_graph_info().  Print all nodes' information,
indenting child nodes and labelling them with a path constructed from
the child names leading to the node from the root (e.g. /file/file).

Note that we open each image with BDRV_O_NO_BACKING, so its backing
child is omitted from this graph, and thus presented in the previous
manner: By simply concatenating all images' information, separated with
blank lines.

This affects two iotests:
- 065: Here we try to get the format node's format specific information.
  The pre-patch code does so by taking all lines from "Format specific
  information:" until an empty line.  This format specific information
  is no longer followed by an empty line, though, but by child node
  information, so limit the range by "Child node '/file':".
- 302: Calls qemu_img() for qemu-img info directly, which does not
  filter the output, so the child node information ends up in the
  output.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-12-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: d570177b50c389f379f93183155a27d44856ab46
      
https://github.com/qemu/qemu/commit/d570177b50c389f379f93183155a27d44856ab46
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M block/monitor/block-hmp-cmds.c
    M block/qapi.c
    M include/block/qapi.h
    M qemu-img.c
    M tests/qemu-iotests/302.out

  Log Message:
  -----------
  qemu-img: Change info key names for protocol nodes

Currently, when querying a qcow2 image, qemu-img info reports something
like this:

image: test.qcow2
file format: qcow2
virtual size: 64 MiB (67108864 bytes)
disk size: 196 KiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false
Child node '/file':
    image: test.qcow2
    file format: file
    virtual size: 192 KiB (197120 bytes)
    disk size: 196 KiB
    Format specific information:
        extent size hint: 1048576

Notably, the way the keys are named is specific for image files: The
filename is shown under "image", the BDS driver under "file format", and
the BDS length under "virtual size".  This does not make much sense for
nodes that are not actually supposed to be guest images, like the /file
child node shown above.

Give bdrv_node_info_dump() a @protocol parameter that gives a hint that
the respective node is probably just used for data storage and does not
necessarily present the data for a VM guest disk.  This renames the keys
so that with this patch, the output becomes:

image: test.qcow2
[...]
Child node '/file':
    filename: test.qcow2
    protocol type: file
    file length: 192 KiB (197120 bytes)
    disk size: 196 KiB
    Format specific information:
        extent size hint: 1048576

(Perhaps we should also rename "Format specific information", but I
could not come up with anything better that will not become problematic
if we guess wrong with the protocol "heuristic".)

This change affects iotest 302, which has protocol node information in
its reference output.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220620162704.80987-13-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 5736527050cfcc5b92521d79fe87b4883059d864
      
https://github.com/qemu/qemu/commit/5736527050cfcc5b92521d79fe87b4883059d864
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M block.c
    M block/blkdebug.c
    M block/blkio.c
    M block/blklogwrites.c
    M block/blkreplay.c
    M block/blkverify.c
    M block/block-backend.c
    M block/commit.c
    M block/copy-on-read.c
    M block/crypto.c
    M block/curl.c
    M block/file-posix.c
    M block/file-win32.c
    M block/filter-compress.c
    M block/gluster.c
    M block/io.c
    M block/iscsi.c
    M block/meson.build
    M block/mirror.c
    M block/monitor/block-hmp-cmds.c
    M block/nbd.c
    M block/nfs.c
    M block/null.c
    M block/nvme.c
    M block/preallocate.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2-bitmap.c
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/qed.c
    M block/quorum.c
    M block/raw-format.c
    M block/rbd.c
    M block/replication.c
    M block/ssh.c
    M block/throttle.c
    M block/vdi.c
    M block/vhdx.c
    M block/vmdk.c
    M block/vpc.c
    M blockdev.c
    M hw/block/block.c
    M hw/scsi/scsi-disk.c
    M include/block/block-common.h
    M include/block/block-io.h
    M include/block/block_int-common.h
    M include/block/block_int-io.h
    M include/block/nbd.h
    M include/block/qapi.h
    M include/qemu/osdep.h
    M include/sysemu/block-backend-io.h
    M qapi/block-core.json
    M qemu-img.c
    M qemu-io-cmds.c
    M scripts/block-coroutine-wrapper.py
    M tests/qemu-iotests/065
    M tests/qemu-iotests/106
    M tests/qemu-iotests/214
    M tests/qemu-iotests/262
    M tests/qemu-iotests/302.out
    M tests/qemu-iotests/308
    M tests/qemu-iotests/312
    M tests/qemu-iotests/common.filter
    M tests/qemu-iotests/common.rc
    M tests/qemu-iotests/iotests.py
    A tests/qemu-iotests/tests/qemu-img-close-errors
    A tests/qemu-iotests/tests/qemu-img-close-errors.out
    M tests/unit/test-block-iothread.c

  Log Message:
  -----------
  Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging

Block layer patches

- qemu-img info: Show protocol-level information
- Move more functions to coroutines
- Make coroutine annotations ready for static analysis
- qemu-img: Fix exit code for errors closing the image
- qcow2 bitmaps: Fix theoretical corruption in error path
- pflash: Only load non-zero parts of backend image to save memory
- Code cleanup and test case improvements

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmPajLURHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9aLjg//bk2uodtEZ1X1y/vU3Lmcqd2wh9gv4f9L
# csFFf17rrxce/m+4daVISHAzS+Zrwpgixt+vMm2dP+jQTZOg0G7/rcaRYYAYa29Y
# Lepr2Qsz0V6HnNpuvUE5hrXiJXU7w5InikLlnoTnwa2H2Nr/wMlzkPX1wh4OdaBy
# 5KG/sjGVsaotrIdYjI3HnTvU/eytn1IcvLwqcTP2M7u8UMNyZkALyDjbC5QxBkwh
# TPVXNGCeDrD6atDOvsmBCkNM3kTmfsGoP5mYyJK5V6iARYV19Nt8tdmt094EFmHk
# VBgeY9y+Q6BctcDe31961+oFqGrsLnT3J7mHDhAoaO0BM8wwWCHfCA7yasmGjCj5
# HGE7/UJ8DYwGQ9T9N8gsx8NmsfyWgIcyRQGuzld72B4FTzES9NXS1JTUFAZHrDUl
# IIaL5bh8aycBKprDBTwvz07a6sDkvmxiR2G0TuS7kFev5O7+qW9dH517PWOWbsRA
# 3+ICzsHCUE2GLi83KkRkBEqRW0CnNmA9qzWNdPdQ0egsEAtNqmJGaFPRLYqQ0ZwR
# gbu7+eK4kUyfqpqieeFxBY53THLE4yxZ3lcg4yFoQWQfKdTCYo69qUNK5AV1hvKY
# TzNAuNbOsipL06dRWy4jInbhzenbiYechyEuoqFv0PpHe1D+JrL8QA2hI/JHDwls
# enNpKYXdkn4=
# =Wf8w
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 01 Feb 2023 16:00:53 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

* tag 'for-upstream' of https://repo.or.cz/qemu/kevin: (38 commits)
  qemu-img: Change info key names for protocol nodes
  qemu-img: Let info print block graph
  iotests/106, 214, 308: Read only one size line
  iotests: Filter child node information
  block/qapi: Add indentation to bdrv_node_info_dump()
  block/qapi: Introduce BlockGraphInfo
  block/qapi: Let bdrv_query_image_info() recurse
  qemu-img: Use BlockNodeInfo
  block: Split BlockNodeInfo off of ImageInfo
  block/vmdk: Change extent info type
  block/file: Add file-specific image info
  block: Improve empty format-specific info dump
  block/nbd: Add missing <qemu/bswap.h> include
  block: Rename bdrv_load/save_vmstate() to bdrv_co_load/save_vmstate()
  block: Convert bdrv_debug_event() to co_wrapper_mixed
  block: Convert bdrv_lock_medium() to co_wrapper
  block: Convert bdrv_eject() to co_wrapper
  block: Convert bdrv_get_info() to co_wrapper_mixed
  block: Convert bdrv_get_allocated_file_size() to co_wrapper
  block: use bdrv_co_refresh_total_sectors when possible
  ...

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


Compare: https://github.com/qemu/qemu/compare/bf4460a8d9a8...5736527050cf



reply via email to

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