- Apr 18, 2023
-
-
It is not useful when configuring with --enable-trace-backends=nop. Signed-off-by:
Carlos Santos <casantos@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230408010410.281263-1-casantos@redhat.com> -
Add the documentation about the example of using virtio-blk driver to pass the zoned block devices through to the guest. Signed-off-by:
Sam Li <faithilikerun@gmail.com> Message-id: 20230407082528.18841-6-faithilikerun@gmail.com [Fix Sphinx indentation error by turning command-lines into pre-formatted text. --Stefan] Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20230407082528.18841-5-faithilikerun@gmail.com
Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Taking account of the new zone append write operation for zoned devices, BLOCK_ACCT_ZONE_APPEND enum is introduced as other I/O request type (read, write, flush). Signed-off-by:
Sam Li <faithilikerun@gmail.com> Message-id: 20230407082528.18841-4-faithilikerun@gmail.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
This patch extends virtio-blk emulation to handle zoned device commands by calling the new block layer APIs to perform zoned device I/O on behalf of the guest. It supports Report Zone, four zone oparations (open, close, finish, reset), and Append Zone. The VIRTIO_BLK_F_ZONED feature bit will only be set if the host does support zoned block devices. Regular block devices(conventional zones) will not be set. The guest os can use blktests, fio to test those commands on zoned devices. Furthermore, using zonefs to test zone append write is also supported. Signed-off-by:
Sam Li <faithilikerun@gmail.com> Message-id: 20230407082528.18841-3-faithilikerun@gmail.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Use scripts/update-linux-headers.sh to update headers to 6.3-rc1. Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Message-id: 20230407082528.18841-2-faithilikerun@gmail.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Dmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20230407081657.17947-5-faithilikerun@gmail.com
Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
The patch tests zone append writes by reporting the zone wp after the completion of the call. "zap -p" option can print the sector offset value after completion, which should be the start sector where the append write begins. Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20230407081657.17947-4-faithilikerun@gmail.com
Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
A zone append command is a write operation that specifies the first logical block of a zone as the write position. When writing to a zoned block device using zone append, the byte offset of the call may point at any position within the zone to which the data is being appended. Upon completion the device will respond with the position where the data has been written in the zone. Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Dmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20230407081657.17947-3-faithilikerun@gmail.com
Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Since Linux doesn't have a user API to issue zone append operations to zoned devices from user space, the file-posix driver is modified to add zone append emulation using regular writes. To do this, the file-posix driver tracks the wp location of all zones of the device. It uses an array of uint64_t. The most significant bit of each wp location indicates if the zone type is conventional zones. The zones wp can be changed due to the following operations issued: - zone reset: change the wp to the start offset of that zone - zone finish: change to the end location of that zone - write to a zone - zone append Signed-off-by:
Sam Li <faithilikerun@gmail.com> Message-id: 20230407081657.17947-2-faithilikerun@gmail.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
The event filename is an absolute path. Convert it to a relative path when writing '#line' directives, to preserve reproducibility of the generated output when different base paths are used. Signed-off-by:
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230406080045.21696-1-thomas.de_schampheleire@nokia.com> -
Introduce the BdrvDmgUncompressFunc type defintion. To emphasis dmg_uncompress_bz2 and dmg_uncompress_lzfse are pointer to functions, declare them using this new typedef. Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20230320152610.32052-1-philmd@linaro.org Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by:
Dmitry Fomichev <dmitry.fomichev@wdc.com> Acked-by:
Kevin Wolf <kwolf@redhat.com> Message-id: 20230324090605.28361-9-faithilikerun@gmail.com [Add index-api.rst to fix "zoned-storage.rst:document isn't included in any toctree" error. --Stefan] Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Acked-by:
Kevin Wolf <kwolf@redhat.com> Message-id: 20230324090605.28361-8-faithilikerun@gmail.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
The new block layer APIs of zoned block devices can be tested by: $ tests/qemu-iotests/check zoned Run each zone operation on a newly created null_blk device and see whether it outputs the same zone information. Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com> Message-id: 20230324090605.28361-7-faithilikerun@gmail.com [Adjust commit message prefix as suggested by Philippe Mathieu-Daudé <philmd@linaro.org>. --Stefan] Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by:
Dmitry Fomichev <dmitry.fomichev@wdc.com> Acked-by:
Kevin Wolf <kwolf@redhat.com> Message-id: 20230324090605.28361-6-faithilikerun@gmail.com [Adjust commit message prefix as suggested by Philippe Mathieu-Daudé <philmd@linaro.org> and clarify that the check is about zoned BlockDrivers. --Stefan] Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
raw-format driver usually sits on top of file-posix driver. It needs to pass through requests of zone commands. Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by:
Hannes Reinecke <hare@suse.de> Reviewed-by:
Dmitry Fomichev <dmitry.fomichev@wdc.com> Acked-by:
Kevin Wolf <kwolf@redhat.com> Message-id: 20230324090605.28361-5-faithilikerun@gmail.com [Adjust commit message prefix as suggested by Philippe Mathieu-Daudé <philmd@linaro.org>. --Stefan] Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Add zoned device option to host_device BlockDriver. It will be presented only for zoned host block devices. By adding zone management operations to the host_block_device BlockDriver, users can use the new block layer APIs including Report Zone and four zone management operations (open, close, finish, reset, reset_all). Qemu-io uses the new APIs to perform zoned storage commands of the device: zone_report(zrp), zone_open(zo), zone_close(zc), zone_reset(zrs), zone_finish(zf). For example, to test zone_report, use following command: $ ./build/qemu-io --image-opts -n driver=host_device, filename=/dev/nullb0 -c "zrp offset nr_zones" Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Hannes Reinecke <hare@suse.de> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Acked-by:
Kevin Wolf <kwolf@redhat.com> Message-id: 20230324090605.28361-4-faithilikerun@gmail.com [Adjust commit message prefix as suggested by Philippe Mathieu-Daudé <philmd@linaro.org> and remove spurious ret = -errno in raw_co_zone_mgmt(). --Stefan] Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Use get_sysfs_str_val() to get the string value of device zoned model. Then get_sysfs_zoned_model() can convert it to BlockZoneModel type of QEMU. Use get_sysfs_long_val() to get the long value of zoned device information. Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Hannes Reinecke <hare@suse.de> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by:
Dmitry Fomichev <dmitry.fomichev@wdc.com> Acked-by:
Kevin Wolf <kwolf@redhat.com> Message-id: 20230324090605.28361-3-faithilikerun@gmail.com [Adjust commit message prefix as suggested by Philippe Mathieu-Daudé <philmd@linaro.org>. --Stefan] Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> -
Signed-off-by:
Sam Li <faithilikerun@gmail.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by:
Hannes Reinecke <hare@suse.de> Reviewed-by:
Dmitry Fomichev <dmitry.fomichev@wdc.com> Acked-by:
Kevin Wolf <kwolf@redhat.com> Message-id: 20230324090605.28361-2-faithilikerun@gmail.com [Adjust commit message prefix as suggested by Philippe Mathieu-Daudé <philmd@linaro.org>. --Stefan] Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Apr 13, 2023
-
-
Peter Maydell authored
Signed-off-by:Peter Maydell <peter.maydell@linaro.org>
-
https://gitlab.com/juan.quintela/qemuPeter Maydell authored
Migration Pull request for 8.0 Last patches found: - peter xu preempt channel fixes. needed for backward compatibility with old machine types. - lukas fix to get compress working again. - fix ram on s390x. Get back to the old code, even when it shouldn't be needed, but as it fails on s390x, just revert. Later, Juan. # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmQ3HgQACgkQ9IfvGFhy # 1yPXGQ/+Pf6HepNUlIr7naYOcpRriXPQF+q1zqo74F9fy2vrGcwJOI6qmRTjsX4E # 9KgXipOz7+b5wSemF7PDKcnBiwyt6UHCH+XXe0h4TpyuORbtABKRgtOhA1/sa84D # HnKp0TwImpAO26tzPa7u49aau/EEVBKAzFVcyn4w56S9qiDWicOpd5kG0CJBIsMJ # Mnvy5fXaqQRewnKiwFoJGWfyhzEToDO6Z/SkT5xYON94P+eiM2xMwXOC5WcGfmY7 # wFGDB+SuyEP8TTn7mV0mmnlFjYe4G07hVARHSDFX3ho4b6q5F+WzfW095G6QKiu9 # n3Pzr7IBGX3sgetPtYwOwGsE9JrfHMFzBRxQZZwq5GSmjk7+agkbXmV7RyV82EYs # KYOhuNF91ca0qvCrGA/eGbbJqVrd7SR5FhS4SQ7oKd5n2au/ZHoKwAgm5lBdcvES # 2TB0MBN1s0JPh6KMV8tPB2m...
-
Coverity spotted a double-free (CID 1508254); we g_string_free(path) and then for some reason immediately call free(path) too. We should just use g_autoptr() for it anyway, which simplifies the code a bit. Fixes: 7a8a749da7d3 ("hw/xen: Move xenstore_store_pv_console_info to xen_console.c") Signed-off-by:David Woodhouse <dwmw@amazon.co.uk> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Apr 12, 2023
-
-
quintela1 authored
I removed that bit on commit: commit c8df4a7aeffcb46020f610526eea621fa5b0cd47 Author: Juan Quintela <quintela@redhat.com> Date: Mon Oct 3 02:00:03 2022 +0200 migration: Split save_live_pending() into state_pending_* Fixes: c8df4a7aeffcb46020f610526eea621fa5b0cd47 Suggested-by:Nina Schoetterl-Glausch <nsg@linux.ibm.com> Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
Since ec6f3ab9 , migration with compress enabled was broken, because the compress threads use a dummy QEMUFile which just acts as a buffer and that commit accidentally changed it to use the outgoing migration channel instead. Fix this by using the dummy file again in the compress threads. Signed-off-by:
Lukas Straub <lukasstraub2@web.de> Reviewed-by:
Juan Quintela <quintela@redhat.com> Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
In 8.0 devel window we reworked preempt channel creation, so that there'll be no race condition when the migration channel and preempt channel got established in the wrong order in commit 5655aab079. However no one noticed that the change will also be not compatible with older qemus, majorly 7.1/7.2 versions where preempt mode started to be supported. Leverage the same pre-7.2 flag introduced in the previous patch to recover the behavior hopefully before 8.0 releases, so we don't break migration when we migrate from 8.0 to older qemu binaries. Fixes: 5655aab079 ("migration: Postpone postcopy preempt channel to be after main") Signed-off-by:
Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
postcopy_qemufile_src object should be owned by one thread, either the main thread (e.g. when at the beginning, or at the end of migration), or by the return path thread (when during a preempt enabled postcopy migration). If that's not the case the access to the object might be racy. postcopy_preempt_shutdown_file() can be potentially racy, because it's called at the end phase of migration on the main thread, however during which the return path thread hasn't yet been recycled; the recycle happens in await_return_path_close_on_source() which is after this point. It means, logically it's posslbe the main thread and the return path thread are both operating on the same qemufile. While I don't think qemufile is thread safe at all. postcopy_preempt_shutdown_file() used to be needed because that's where we send EOS to dest so that dest can safely shutdown the preempt thread. To avoid the possible race, remove this only place that a race can happen. Instead we figure out another way to safely close the preempt thread on dest. The core idea during postcopy on deciding "when to stop" is that dest will send a postcopy SHUT message to src, telling src that all data is there. Hence to shut the dest preempt thread maybe better to do it directly on dest node. This patch proposed such a way that we change postcopy_prio_thread_created into PreemptThreadStatus, so that we kick the preempt thread on dest qemu by a sequence of: mis->preempt_thread_status = PREEMPT_THREAD_QUIT; qemu_file_shutdown(mis->postcopy_qemufile_dst); While here shutdown() is probably so far the easiest way to kick preempt thread from a blocked qemu_get_be64(). Then it reads preempt_thread_status to make sure it's not a network failure but a willingness to quit the thread. We could have avoided that extra status but just rely on migration status. The problem is postcopy_ram_incoming_cleanup() is just called early enough so we're still during POSTCOPY_ACTIVE no matter what.. So just make it simple to have the status introduced. One flag x-preempt-pre-7-2 is added to keep old pre-7.2 behaviors of postcopy preempt. Fixes: 9358982744 ("migration: Send requested page directly in rp-return thread") Signed-off-by:
Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
TLS iochannel will inherit io_shutdown() from the master ioc, however we missed to do that on the server side. This will e.g. allow qemu_file_shutdown() to work on dest QEMU too for migration. Acked-by:
Daniel P. Berrangé <berrange@redhat.com> Signed-off-by:
Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by:
Juan Quintela <quintela@redhat.com>
-
https://gitlab.com/bonzini/qemuPeter Maydell authored
Fix NFS driver issue. # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmQ22+MUHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroOYfwgAm3K121ALsF2kDplg+nDA/H69DbCi # HG0iozJc//MmqF+15dgmClcBn+567U7evSesATv0Bx/UBVN8XtUoS/Krf+QSHd80 # Ycxw1TBgD2Ddc1MmVuYPZetvs8j2a+cYEQIW3ZP5o7Ng88o2BEYiyU1CXA/opfXy # Lz1lQd3OHK7p00h0uHlqG41XZEuMkj5I6uorqvyDoqVkojtq2agbA7YWEsuiKyzj # owztvajmh4v0vDSMVuFGr721VIiAm2sFh7JoL69E4EOig47QD3mPPDm8wX48O0dM # ISKztYKlsSIcGFqpMPsjXioQOiMfp/StfsS1kr6X4B0q4r7UXrpQQ+TMkA== # =sStc # -----END PGP SIGNATURE----- # gpg: Signature made Wed 12 Apr 2023 17:27:15 BST # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * tag 'for-upstream' of https://gitlab.com/bonzini/qemu : block/nfs: do not poll within a coroutine Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Paolo Bonzini authored
Since the former nfs_get_allocated_file_size is now a coroutine function, it must suspend rather than poll. Switch BDRV_POLL_WHILE() to a qemu_coroutine_yield() loop and schedule nfs_co_generic_bh_cb() in place of the call to bdrv_wakeup(). Fixes: 82618d7b ("block: Convert bdrv_get_allocated_file_size() to co_wrapper", 2023-02-01) Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Message-Id: <20230412112606.80983-1-pbonzini@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
git://git.infradead.org/qemu-nvmePeter Maydell authored
hw/nvme coverity fixes Fix two issues reported by coverity (CID 1451080 and 1451082). # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCgAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmQ2gfEACgkQTeGvMW1P # DemcEQf/V+arKs9OFhfqu3OtKQu5R4F2i2Tq3aRulrbZr/dPGkkLjSQjgGdkbg0F # 8TZQYezFGZdg45QqxfxpVxPf8hrlGX6c/cbVZp9BnIGGXForLLHfrvNQpVVg5Ldm # 8fA5zBccbnH2ER4nf12xf56WzjKWIpv5Xt/+hqOSoghThKfUxjIowR58fxoZySy6 # zl0cr6+FMnMZkLxGN0EslckNzYzpX5aXfJLMZKPG3G07EVmTgcGfJxjw0pWkzbq6 # ictMeP8BTbOU4IGLC2SIRppkiWEr3rUCL4aPhlPg90rIyXDU4onYP8dr0Y5ZI0gY # QFtaZpTYEeRw84AJhgyR4U6h37UE/g== # =kGwj # -----END PGP SIGNATURE----- # gpg: Signature made Wed 12 Apr 2023 11:03:29 BST # gpg: using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9 # gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [full] # gpg: aka "Klaus Jensen <k.jensen@samsung.com>" [full] # Primary key fingerprint: DDCA 4D9C 9EF9 31CC 3468 4272 63D5 6FC5 E55D A838 # Subkey fingerprint: 5228 33AA 75E2 DCE6 A247 66C0 4DE1 AF31 6D4F 0DE9 * tag 'coverity-fixes-pull-request' of git://git.infradead.org/qemu-nvme : hw/nvme: fix memory leak in nvme_dsm hw/nvme: fix memory leak in fdp ruhid parsing Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Klaus Jensen authored
The iocb (and the allocated memory to hold LBA ranges) leaks if reading the LBA ranges fails. Fix this by adding a free and an unref of the iocb. Reported-by: Coverity (CID 1508281) Fixes: d7d1474fd85d ("hw/nvme: reimplement dsm to allow cancellation") Reviewed-by:Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
Klaus Jensen <k.jensen@samsung.com>
-
Klaus Jensen authored
Coverity reports a memory leak of memory when parsing ruhids at namespace initialization. Since this is just working memory, not needed beyond the scope of the functions, fix this by adding a g_autofree annotation. Reported-by: Coverity (CID 1507979) Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation") Reviewed-by:Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
Klaus Jensen <k.jensen@samsung.com>
-
- Apr 11, 2023
-
-
https://repo.or.cz/qemu/kevinPeter Maydell authored
Block layer patches - Fix VHDX image corruption bug - Fix for performance regression: Remove bdrv_co_get_geometry coroutines from I/O hot path # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmQ1dDARHGt3b2xmQHJl # ZGhhdC5jb20ACgkQfwmycsiPL9ZM8BAArqnJjr2iAVT/yYHZKO8GUyrt3Ndq9aAb # hlAoMud0Xkof588I1W4AelOBYz/Cm4OEeFNAYxFbWif6t1iSB/J3FG6EQMCRqOnV # 1GHIrJO9tolhjGx9GcjbYjXVJDyIsKDhcNCFJ9gke7+zVZLT8bLA5ibdZ2xYEcAp # DfH27pBa6dlLd2CnDfkatpUwqqUDju+iXLaB4kGN/AG4Xv61Jk9ZqpRIyl1lToXO # C9HDbHh3U/7fT2q9lMUXecOQnRFhXhvYSyiU+vcCFJPdijYPacC/HqJo200fG67y # NDw/xviip3nFQWpxB06qx5A/H3UtmacGRSeckPvN7ZuEG4qFJSgYFsJL2+Rd11gu # y2it06WWpYz+CFtlbfTkDuKj35F9VGFcmdfwnWxcmpMYDBWLbCJuzMpZJkJj5ahm # QT6cv138nSvhvMpXLLZXER9opdGqqTU7LS2NqSTDFDKlPOnhofl1+FK0dhjrecEf # A3bVfY8z8j+R2CYRzFINf2FUJA91XJjbv2kaJkV6Jq3x1usmgsm+QmCEefPpYF2l # nlx5wFewxlqg8skMKDrKPXpB7d3KiKHy829HRJJtgg9RBoI9yST9kSRQ/o1IXlnP # xCPG23Trik0dj9W178MDrBwf9ug0EKg2a4Ny3ohLq48sJP9pzjL1bR6j0Zww+tcz # XMvgFSKspeY= # =4z1y # -----END PGP SIGNATURE----- # gpg: Signature made Tue 11 Apr 2023 15:52:32 BST # 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 : block, block-backend: write some hot coroutine wrappers by hand block-backend: ignore inserted state in blk_co_nb_sectors block-backend: inline bdrv_co_get_geometry migration/block: replace uses of blk_nb_sectors that do not check result block: remove has_variable_length from BlockDriver block: refresh bs->total_sectors on reopen block: remove has_variable_length from filters block: move has_variable_length to BlockLimits iotests: Regression test for vhdx log corruption block/vhdx: fix dynamic VHDX BAT corruption Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
The introduction of the graph lock is causing blk_get_geometry, a hot function used in the I/O path, to create a coroutine. However, the only part that really needs to run in coroutine context is the call to bdrv_co_refresh_total_sectors, which in turn only happens in the rare case of host CD-ROM devices. So, write by hand the three wrappers on the path from blk_co_get_geometry to bdrv_co_refresh_total_sectors, so that the coroutine wrapper is only created if bdrv_nb_sectors actually calls bdrv_refresh_total_sectors. Reported-by:
Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20230407153303.391121-9-pbonzini@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
All callers of blk_co_nb_sectors (and blk_nb_sectors) are able to handle a non-inserted CD-ROM as a zero-length file, they do not need to raise an error. Not using blk_co_is_available() aligns the function with blk_co_get_geometry(), which becomes a simple wrapper for blk_co_nb_sectors(). It will also make it possible to skip the creation of a coroutine in the (common) case where bs->bl.has_variable_length is false. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20230407153303.391121-8-pbonzini@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
bdrv_co_get_geometry is only used in blk_co_get_geometry. Inline it in there, to reduce the number of wrappers for bs->total_sectors. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20230407153303.391121-7-pbonzini@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Uses of blk_nb_sectors must check whether the result is negative. Otherwise, underflow can happen. Fortunately, alloc_aio_bitmap() and bmds_aio_inflight() both have an alternative way to retrieve the number of sectors in the file. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20230407153303.391121-6-pbonzini@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Fill in the field in BlockLimits directly for host devices, and copy it from there for the raw format. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20230407153303.391121-5-pbonzini@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
After reopening a BlockDriverState, it's possible that the size of the underlying file has changed. This for example is covered by test 171. Right now, this is handled by the raw driver's has_variable_length = true setting. Since this will be removed by the next patch, handle it on reopen instead, together with the existing bdrv_refresh_limits. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20230407153303.391121-4-pbonzini@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-