qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 5c6ef7: tests/qemu-iotests/312: Mark "quorum"


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 5c6ef7: tests/qemu-iotests/312: Mark "quorum" as required ...
Date: Tue, 24 Jan 2023 07:03:41 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 5c6ef792c634d8bff9cd0c006b2f97273b719b4d
      
https://github.com/qemu/qemu/commit/5c6ef792c634d8bff9cd0c006b2f97273b719b4d
  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: d6a5d174ef168ade898074056361c352d5198d8a
      
https://github.com/qemu/qemu/commit/d6a5d174ef168ade898074056361c352d5198d8a
  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: 8aa452a92d1765528dcdefbadd4a71ee7aff5e1b
      
https://github.com/qemu/qemu/commit/8aa452a92d1765528dcdefbadd4a71ee7aff5e1b
  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: 93982ba447b9b255345550db0fbec38bc56695f4
      
https://github.com/qemu/qemu/commit/93982ba447b9b255345550db0fbec38bc56695f4
  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: 1d9ad106a0c4ee489038544ef4ecece51bac5df7
      
https://github.com/qemu/qemu/commit/1d9ad106a0c4ee489038544ef4ecece51bac5df7
  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: 1c1ae95ab86ae7ecc348d1175309ade4dce24270
      
https://github.com/qemu/qemu/commit/1c1ae95ab86ae7ecc348d1175309ade4dce24270
  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: 90fb98403ddcd2ed32d83ae2950f1ec43071df55
      
https://github.com/qemu/qemu/commit/90fb98403ddcd2ed32d83ae2950f1ec43071df55
  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: 5f6d8679176797745731a692affcd428eb65b2b4
      
https://github.com/qemu/qemu/commit/5f6d8679176797745731a692affcd428eb65b2b4
  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: 58a289eefed0d13e35a014c3f63c540c6311575d
      
https://github.com/qemu/qemu/commit/58a289eefed0d13e35a014c3f63c540c6311575d
  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: 3cf0ab8f2e27fda82525a7369e3fae67785b44e9
      
https://github.com/qemu/qemu/commit/3cf0ab8f2e27fda82525a7369e3fae67785b44e9
  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: 9cf1f9dda4c9cd12a85238bbc1224fc737ab462a
      
https://github.com/qemu/qemu/commit/9cf1f9dda4c9cd12a85238bbc1224fc737ab462a
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: a1ebd86a90334c83b73fd55fd7f5df51468893cd
      
https://github.com/qemu/qemu/commit/a1ebd86a90334c83b73fd55fd7f5df51468893cd
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 9daa67ec4880ba41eb0dbd41c8f878d98d83c471
      
https://github.com/qemu/qemu/commit/9daa67ec4880ba41eb0dbd41c8f878d98d83c471
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 971db0025336029cbf6d0b2f64b46977e197d394
      
https://github.com/qemu/qemu/commit/971db0025336029cbf6d0b2f64b46977e197d394
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 4c8a8ca4a316364fb7dbff67fb31870ab233dad1
      
https://github.com/qemu/qemu/commit/4c8a8ca4a316364fb7dbff67fb31870ab233dad1
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: c5ac9d1c8579c335c8dadaeb6477a3d51b8ce48e
      
https://github.com/qemu/qemu/commit/c5ac9d1c8579c335c8dadaeb6477a3d51b8ce48e
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 9b8c7f9f688478d2f624cdc9073697b061bd7ab8
      
https://github.com/qemu/qemu/commit/9b8c7f9f688478d2f624cdc9073697b061bd7ab8
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: dc7e8434458f433ea326c1c4d04facdee4aa49da
      
https://github.com/qemu/qemu/commit/dc7e8434458f433ea326c1c4d04facdee4aa49da
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: c2b234664521da32d70f91587a78bd885a700006
      
https://github.com/qemu/qemu/commit/c2b234664521da32d70f91587a78bd885a700006
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: b4ace6a1b9f5f0c914b541644764bf9b837367f7
      
https://github.com/qemu/qemu/commit/b4ace6a1b9f5f0c914b541644764bf9b837367f7
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 233c0fc1f977169e4a32e881ff0774080ff47b4e
      
https://github.com/qemu/qemu/commit/233c0fc1f977169e4a32e881ff0774080ff47b4e
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 3a562517e5acea8c1a2220953d743bf9461e06af
      
https://github.com/qemu/qemu/commit/3a562517e5acea8c1a2220953d743bf9461e06af
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 75c39ad88aeafe6884adf3c6459f046fd872814a
      
https://github.com/qemu/qemu/commit/75c39ad88aeafe6884adf3c6459f046fd872814a
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: f6f03e715f3bfe1798725c9299982c9fabed41dd
      
https://github.com/qemu/qemu/commit/f6f03e715f3bfe1798725c9299982c9fabed41dd
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 960b79976931ef7e41e0acc387968728ea774761
      
https://github.com/qemu/qemu/commit/960b79976931ef7e41e0acc387968728ea774761
  Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: a27af70e8cc07dd6cf2a21145dbecec9160dc6af
      
https://github.com/qemu/qemu/commit/a27af70e8cc07dd6cf2a21145dbecec9160dc6af
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-01-24 (Tue, 24 Jan 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: bafbc3dc83a839542bdbd892f4aa3db8686ef0b7
      
https://github.com/qemu/qemu/commit/bafbc3dc83a839542bdbd892f4aa3db8686ef0b7
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 00f86e59772cb6ee27eef4229b8dd379bd92687f
      
https://github.com/qemu/qemu/commit/00f86e59772cb6ee27eef4229b8dd379bd92687f
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 9c7bbf1993a160a8c10b38fe95e7f86df7a1267f
      
https://github.com/qemu/qemu/commit/9c7bbf1993a160a8c10b38fe95e7f86df7a1267f
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 478efd7885dc7487d8201b06a4844d7a3eadc5e1
      
https://github.com/qemu/qemu/commit/478efd7885dc7487d8201b06a4844d7a3eadc5e1
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 1e08394bd64f03ea9406383b63ca13deb8644e51
      
https://github.com/qemu/qemu/commit/1e08394bd64f03ea9406383b63ca13deb8644e51
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 9f9af696481847274ca49340d7dd7997c03b3e72
      
https://github.com/qemu/qemu/commit/9f9af696481847274ca49340d7dd7997c03b3e72
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: e757c02aec66cee83fcb444f26ce3921be1d9222
      
https://github.com/qemu/qemu/commit/e757c02aec66cee83fcb444f26ce3921be1d9222
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: a032fd1ed0618df88465fc9140ad2efe1b7599d7
      
https://github.com/qemu/qemu/commit/a032fd1ed0618df88465fc9140ad2efe1b7599d7
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 1ce802399327a3aa3f696c703310f0640c49061f
      
https://github.com/qemu/qemu/commit/1ce802399327a3aa3f696c703310f0640c49061f
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 65d6f1ddfdbfd5830fd394bace049e39539473c0
      
https://github.com/qemu/qemu/commit/65d6f1ddfdbfd5830fd394bace049e39539473c0
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: e5c005fd9998c64b3e07cee43a92ce0ee6960ba4
      
https://github.com/qemu/qemu/commit/e5c005fd9998c64b3e07cee43a92ce0ee6960ba4
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 19a9c20a68f47b133e7bc8da789f2b21831fb9b0
      
https://github.com/qemu/qemu/commit/19a9c20a68f47b133e7bc8da789f2b21831fb9b0
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2023-01-24 (Tue, 24 Jan 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: 0bcfebc7446054b82ec5fabcc8c2555d5804e835
      
https://github.com/qemu/qemu/commit/0bcfebc7446054b82ec5fabcc8c2555d5804e835
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2023-01-24 (Tue, 24 Jan 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+fwmycsiPL9YFAmPPvvIRHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9b57A/7BdP0PTzs21jN7i59kIOtG4biwI+P2qv/
# b7sNFQaGcFpUO0GKSBSD99Nzv40xXiA016WuVK65Jsp0PACsaRCnCLMKXCXgSeUO
# mh42QVmhZdS+PzpcNYmu2EnltOLXvRGaPojRjVuHhoCf7A73vLabUyJ2UjZRJM+8
# niDEM9MkWv07pjpL0D1Wz/q4grqKuvDgx9mkx1Wap+KZdvAFS3hUMtvV3q58zs4q
# v47hSvB5uK1zFMVQPd67rcBrK2IFbDVDlP2K3RerHcHwCjpCCRJ3mmGnYfbRM66s
# T/zilT5Fm4a3xtrNPn4hhjptRJDGWhwYbOgWAZO8VMvngtfVb+WgNEkoRJO8ZeYr
# B/YGOl3aY2p+xTycRrkd2Y92nKC2rgkDQcEBWOUH5YkAGlqv+eB8Ec3BF/UyFGcF
# XcK0J6lVvc/2zISGDHPQzdTL1b793GWTiVi1GeUqhYy5HIdw1XbxqNBecvangtqa
# t6ZB4ZGEzyct2WdzB6If0BfxXfbGWfb+YUwAp6LFm70FcZV5tdB2uunslS53I8X7
# f8zfMlL4IfLcxPNytdXsfV77/Y9jp6DJWGnSrZGyHiW1ROOk7vs78S07zvvVqlIc
# YNyTY+4u9k+YXPxz4vbrH6bkekg9ATGHyaTygWDpPjArWi7tLTgV3X2LKYYukAug
# YvyFclsNbbM=
# =HDrC
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 24 Jan 2023 11:20:18 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/31563f7895b9...0bcfebc74460



reply via email to

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