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: Wed, 01 Feb 2023 03:19:01 -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: a6a9b7bf031b6eaebe4c37bf78c08596a28fe0c2
      
https://github.com/qemu/qemu/commit/a6a9b7bf031b6eaebe4c37bf78c08596a28fe0c2
  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: 4a3ac78f542256cdecb61bc667c09e60a317bf8e
      
https://github.com/qemu/qemu/commit/4a3ac78f542256cdecb61bc667c09e60a317bf8e
  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: e82e19aa830b2bfe6ca9354b457b8327a7a4921c
      
https://github.com/qemu/qemu/commit/e82e19aa830b2bfe6ca9354b457b8327a7a4921c
  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: f145f0a4f85b09a013c3baa02c370a305d8cc169
      
https://github.com/qemu/qemu/commit/f145f0a4f85b09a013c3baa02c370a305d8cc169
  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: 503787e4e51de92f776a0714652b3ae1b42f48d1
      
https://github.com/qemu/qemu/commit/503787e4e51de92f776a0714652b3ae1b42f48d1
  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: e16c432fb9c74190e9674c7d50e78033c5041e63
      
https://github.com/qemu/qemu/commit/e16c432fb9c74190e9674c7d50e78033c5041e63
  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: 2da19ab1ad2627034a8f5dc58dd92024aae35a03
      
https://github.com/qemu/qemu/commit/2da19ab1ad2627034a8f5dc58dd92024aae35a03
  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: cf72c8445c21c01c7383dec921c154a386688ca1
      
https://github.com/qemu/qemu/commit/cf72c8445c21c01c7383dec921c154a386688ca1
  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: 1a66e92f0a9afac80390830f07e3a5689c9f2589
      
https://github.com/qemu/qemu/commit/1a66e92f0a9afac80390830f07e3a5689c9f2589
  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: 711e7a73046d8e017791834388d230281085fca1
      
https://github.com/qemu/qemu/commit/711e7a73046d8e017791834388d230281085fca1
  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: 03cb06c867e5ca569a435d8b17983c266351ea90
      
https://github.com/qemu/qemu/commit/03cb06c867e5ca569a435d8b17983c266351ea90
  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: 3701aacf3cd528e000a07634e3c77b3106224c6b
      
https://github.com/qemu/qemu/commit/3701aacf3cd528e000a07634e3c77b3106224c6b
  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: 0f21a35fb71ed09ec9aa1bf73e08ad5feb4a9820
      
https://github.com/qemu/qemu/commit/0f21a35fb71ed09ec9aa1bf73e08ad5feb4a9820
  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: d377b376d4ecc88e8fc998a23e4016a5ebdd9342
      
https://github.com/qemu/qemu/commit/d377b376d4ecc88e8fc998a23e4016a5ebdd9342
  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: c8ee691bb51eb97e3fdc32329ff3eb04702a3735
      
https://github.com/qemu/qemu/commit/c8ee691bb51eb97e3fdc32329ff3eb04702a3735
  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: 36f9c44098e1491a333a8dc366f58699968f5e8e
      
https://github.com/qemu/qemu/commit/36f9c44098e1491a333a8dc366f58699968f5e8e
  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: 69f3524accec0c34a79b7ce8faf58463afa3a4b7
      
https://github.com/qemu/qemu/commit/69f3524accec0c34a79b7ce8faf58463afa3a4b7
  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: f15e87aea1edac4c1cfdba4506c97b3734882635
      
https://github.com/qemu/qemu/commit/f15e87aea1edac4c1cfdba4506c97b3734882635
  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: a18d204a86f26ae5d3ebcf766aaff29b81976507
      
https://github.com/qemu/qemu/commit/a18d204a86f26ae5d3ebcf766aaff29b81976507
  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: 01cca203656721384763b38f2c3ad5789a2825a6
      
https://github.com/qemu/qemu/commit/01cca203656721384763b38f2c3ad5789a2825a6
  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: 1db831f4df1a871c1a2b29f2ccaa8417dd9c44cf
      
https://github.com/qemu/qemu/commit/1db831f4df1a871c1a2b29f2ccaa8417dd9c44cf
  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: e5d256ffd133116effdab5943e828fb0c133d795
      
https://github.com/qemu/qemu/commit/e5d256ffd133116effdab5943e828fb0c133d795
  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: 389d2fd783f91d4612ad90ca36b601edee6bbeaa
      
https://github.com/qemu/qemu/commit/389d2fd783f91d4612ad90ca36b601edee6bbeaa
  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: a01520f8425cc48979927540a2498ed0d126011a
      
https://github.com/qemu/qemu/commit/a01520f8425cc48979927540a2498ed0d126011a
  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: f4b658935a98dcaa4bdee42e2bd1406becfd0ef0
      
https://github.com/qemu/qemu/commit/f4b658935a98dcaa4bdee42e2bd1406becfd0ef0
  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: 7b0f17cff4ceae6e03dd37190fa7de1ad4826e03
      
https://github.com/qemu/qemu/commit/7b0f17cff4ceae6e03dd37190fa7de1ad4826e03
  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: 7bb41715b33d6d2abfedc61c34a6e8299528c68e
      
https://github.com/qemu/qemu/commit/7bb41715b33d6d2abfedc61c34a6e8299528c68e
  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: 1fb9d23f06e0eea297fd57ac62f0fa9efbce865f
      
https://github.com/qemu/qemu/commit/1fb9d23f06e0eea297fd57ac62f0fa9efbce865f
  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: 07634196fe240c3668be52ee247827e94fedbc1f
      
https://github.com/qemu/qemu/commit/07634196fe240c3668be52ee247827e94fedbc1f
  Author: Peter Maydell <peter.maydell@linaro.org>
  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/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+fwmycsiPL9YFAmPQGGIRHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9amExAAwDNLEhwLym6goQ+2UfvTXxZuqVSlWqRh
# uKkJaY1TtOcfcuGx4Xm4HcEnl1wJ+vmlMwSbeAbibI6heQoo/oKAO50aL3UurswR
# zOg/0bqhDeRZ4smIpB28Bbr5OfBRZqXOMqXz1uI97zvghsA3zE468gbXNTdFz7Mi
# hhRza4ukTgBuP5oeJVTbPvF1DMNTxZfATwQuFOmAPfaw67R2z3R33ZxrjuS1Zk+f
# /SSzUJQyrePbyY5OTVxi+zrhZAu5NxYQNfNxClcBthGfGdweQipsumDcEJggERdz
# cx8XNvI0wANHcjwZdHlmHwmXONbuykxeG+OwWMoeXUBg4thLqIiPfvr/KPCCpuFq
# lUOTCOwFLiXz3RzgOGtUZDVOVoCBt5B/NrUGeJL5KFNiPyG7PDp+vAXKymiMMRbd
# Egfp1xzFbtpeVIQ4wwfIIkzLULT3NiXvHg8uqIHbsd2UBNu711taODW+JtrNQD7p
# g0mbCvj/PBcYLe4wEB/2foQV0PcObTCCExgYshyc9fObzMDO+5SXd8SXCojsRx5u
# Tj28g94LISYTc5Z1OuGsOch92S3k5FBjN9DwiAb8eISGw/You+bZ9YiV4fH+admr
# IvPKyieauQjNKVVZDJioB5qCAsVS6Sg4m5Q3VQyZ4PDfdJD6q8dtkizCVh5LkGQL
# avMm6APPxX0=
# =ql1I
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 24 Jan 2023 17:41:54 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/d890787eff2c...07634196fe24



reply via email to

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