Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-04-10 Thread Michael Tokarev
07.04.2025 18:59, Kevin Wolf пишет: Originally, all failed SG_IO requests called scsi_handle_rw_error() to apply the configured error policy. However, commit f3126d65, which was supposed to be a mere refactoring for scsi-disk.c, broke this and accidentally completed the SCSI request without consi

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-04-10 Thread Kevin Wolf
Am 10.04.2025 um 14:37 hat Michael Tokarev geschrieben: > 07.04.2025 18:59, Kevin Wolf пишет: > > Originally, all failed SG_IO requests called scsi_handle_rw_error() to > > apply the configured error policy. However, commit f3126d65, which was > > supposed to be a mere refactoring for scsi-disk.c,

Re: [PATCH 00/10] Enable QEMU to run on browsers

2025-04-10 Thread Kohei Tokunaga
Hi Philippe, > On 9/4/25 21:21, Stefan Hajnoczi wrote: > > On Mon, Apr 07, 2025 at 11:45:51PM +0900, Kohei Tokunaga wrote: > >> This patch series enables QEMU's system emulator to run in a browser using > >> Emscripten. > >> It includes implementations and workarounds to address browser environmen

Re: [RFC PATCH-for-8.0 09/10] hw/virtio: Extract vhost_user_ram_slots_max() to vhost-user-target.c

2025-04-10 Thread Pierrick Bouvier
On 4/10/25 05:14, Philippe Mathieu-Daudé wrote: Hi Pierrick, On 13/12/22 00:05, Philippe Mathieu-Daudé wrote: The current definition of VHOST_USER_MAX_RAM_SLOTS is target specific. By converting this definition to a runtime vhost_user_ram_slots_max() helper declared in a target specific unit, w

Re: [PATCH v3 0/3] Enable QEMU NVMe userspace driver on s390x

2025-04-10 Thread Farhan Ali
On 4/3/2025 2:24 PM, Alex Williamson wrote: On Thu, 3 Apr 2025 13:33:17 -0700 Farhan Ali wrote: On 4/3/2025 11:05 AM, Alex Williamson wrote: On Thu, 3 Apr 2025 10:33:52 -0700 Farhan Ali wrote: On 4/3/2025 9:27 AM, Alex Williamson wrote: On Thu, 3 Apr 2025 11:44:42 -0400 Stefan Hajnocz

Re: [PATCH 01/10] various: Fix type conflict of GLib function pointers

2025-04-10 Thread Paolo Bonzini
On 4/7/25 16:45, Kohei Tokunaga wrote: On emscripten, function pointer casts can cause function call failure. This commit fixes the function definition to match to the type of the function call. - qtest_set_command_cb passed to g_once should match to GThreadFunc Sending an alternative patch th

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-04-10 Thread Michael Tokarev
10.04.2025 16:14, Kevin Wolf wrote: Am 10.04.2025 um 14:37 hat Michael Tokarev geschrieben: ...>> Does it make sense to apply this one for older stable qemu series? In particular, in 8.2, we lack cfe0880835cd3 "scsi-disk: Use positive return value for status in dma_readv/writev", which seems to

[PATCH] scsi: add conversion from ENODEV to sense

2025-04-10 Thread Paolo Bonzini
This is mostly for completeness; I noticed it because ENODEV is used internally within scsi-disk.c, but when scsi_sense_from_errno(ENODEV) is called the resulting sense is never used and instead scsi_sense_from_host_status() is called later by scsi_req_complete_failed(). Signed-off-by: Paolo Bonz

Re: [PATCH 02/10] various: Define macros for dependencies on emscripten

2025-04-10 Thread Paolo Bonzini
On 4/7/25 16:45, Kohei Tokunaga wrote: +#ifdef EMSCRIPTEN +/* + * emscripten exposes copy_file_range declaration but doesn't provide the + * implementation in the final link. Define the stub here but avoid type + * conflict with the emscripten's header. + */ +ssize_t copy_file_range(int in_fd, of

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-04-10 Thread Paolo Bonzini
On Thu, Apr 10, 2025 at 4:25 PM Paolo Bonzini wrote: > You should set ret = 0 here to avoid going down the > scsi_sense_from_errno() path. > > Otherwise, > > Reviewed-by: Paolo Bonzini Okay, going down the scsi_sense_from_errno() path is more or less harmless because status and sense end up unus

Re: [PATCH 00/10] Enable QEMU to run on browsers

2025-04-10 Thread Kohei Tokunaga
Hi Stefan, > > This patch series enables QEMU's system emulator to run in a browser using > > Emscripten. > > It includes implementations and workarounds to address browser environment > > limitations, as shown in the following. > > I think it would be great to merge this even if there are limitat

Re: [PATCH for-10.0] scsi-disk: Apply error policy for host_status errors again

2025-04-10 Thread Paolo Bonzini
On 4/7/25 17:59, Kevin Wolf wrote: Originally, all failed SG_IO requests called scsi_handle_rw_error() to apply the configured error policy. However, commit f3126d65, which was supposed to be a mere refactoring for scsi-disk.c, broke this and accidentally completed the SCSI request without consid

Re: [PATCH 08/10] hw/9pfs: Allow using hw/9pfs with emscripten

2025-04-10 Thread Christian Schoenebeck
On Monday, April 7, 2025 4:45:59 PM CEST Kohei Tokunaga wrote: > Emscripten's fiber does not support submitting coroutines to other > threads. So this commit modifies hw/9pfs/coth.h to disable this behavior > when compiled with Emscripten. The lack of being able to dispatch a coroutine to a worker

Re: [PATCH 08/10] hw/9pfs: Allow using hw/9pfs with emscripten

2025-04-10 Thread Paolo Bonzini
On 4/7/25 16:45, Kohei Tokunaga wrote: Emscripten's fiber does not support submitting coroutines to other threads. Does it work as long as the thread does not rewind? diff --git a/hw/9pfs/9p-util-stub.c b/hw/9pfs/9p-util-stub.c new file mode 100644 index 00..57c89902ab --- /dev/null

Re: [PATCH 00/10] Enable QEMU to run on browsers

2025-04-10 Thread Philippe Mathieu-Daudé
On 9/4/25 21:21, Stefan Hajnoczi wrote: On Mon, Apr 07, 2025 at 11:45:51PM +0900, Kohei Tokunaga wrote: This patch series enables QEMU's system emulator to run in a browser using Emscripten. It includes implementations and workarounds to address browser environment limitations, as shown in the f

Re: [RFC PATCH-for-8.0 09/10] hw/virtio: Extract vhost_user_ram_slots_max() to vhost-user-target.c

2025-04-10 Thread Philippe Mathieu-Daudé
Hi Pierrick, On 13/12/22 00:05, Philippe Mathieu-Daudé wrote: The current definition of VHOST_USER_MAX_RAM_SLOTS is target specific. By converting this definition to a runtime vhost_user_ram_slots_max() helper declared in a target specific unit, we can have the rest of vhost-user.c target indepe

Re: [PATCH v2 2/2] qapi/block-core: derpecate some block-job- APIs

2025-04-10 Thread Markus Armbruster
Typo in subject, make it "deprecate". Vladimir Sementsov-Ogievskiy writes: > For change, pause, resume, complete, dismiss and finalize actions > corresponding job- and block-job commands are almost equal. The > difference is in find_block_job_locked() vs find_job_locked() > functions. What's dif

Re: [PATCH v3 1/2] qapi: synchronize jobs and block-jobs documentation

2025-04-10 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Actualize documentation and synchronize it for commands which actually > call the same functions internally. > > Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Markus Armbruster

Re: [RFC PATCH-for-8.0 09/10] hw/virtio: Extract vhost_user_ram_slots_max() to vhost-user-target.c

2025-04-10 Thread Philippe Mathieu-Daudé
On 10/4/25 16:36, Pierrick Bouvier wrote: On 4/10/25 05:14, Philippe Mathieu-Daudé wrote: Hi Pierrick, On 13/12/22 00:05, Philippe Mathieu-Daudé wrote: The current definition of VHOST_USER_MAX_RAM_SLOTS is target specific. By converting this definition to a runtime vhost_user_ram_slots_max() h

Re: [RFC PATCH-for-8.0 09/10] hw/virtio: Extract vhost_user_ram_slots_max() to vhost-user-target.c

2025-04-10 Thread Pierrick Bouvier
On 4/10/25 10:21, Philippe Mathieu-Daudé wrote: On 10/4/25 16:36, Pierrick Bouvier wrote: On 4/10/25 05:14, Philippe Mathieu-Daudé wrote: Hi Pierrick, On 13/12/22 00:05, Philippe Mathieu-Daudé wrote: The current definition of VHOST_USER_MAX_RAM_SLOTS is target specific. By converting this def

Re: [PATCH 07/10] tcg: Add a TCG backend for WebAssembly

2025-04-10 Thread Philippe Mathieu-Daudé
On 7/4/25 16:45, Kohei Tokunaga wrote: A TB consists of a wasmTBHeader followed by the data listed below. The wasmTBHeader contains pointers for each element: - TCI code - Wasm code - Array of function indices imported into the Wasm instance - Counter tracking the number of TB executions - Point

[PATCH v2 1/2] file-posix: probe discard alignment on Linux block devices

2025-04-10 Thread Stefan Hajnoczi
Populate the pdiscard_alignment block limit so the block layer is able align discard requests correctly. Signed-off-by: Stefan Hajnoczi --- block/file-posix.c | 56 +- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/b

[PATCH v2 2/2] block/io: skip head/tail requests on EINVAL

2025-04-10 Thread Stefan Hajnoczi
When guests send misaligned discard requests, the block layer breaks them up into a misaligned head, an aligned main body, and a misaligned tail. The file-posix block driver on Linux returns -EINVAL on misaligned discard requests. This causes bdrv_co_pdiscard() to fail and guests configured with w

[PATCH v2 0/2] block: discard alignment fixes

2025-04-10 Thread Stefan Hajnoczi
v2: - Fix inverted logic in alignment check [Qing Wang] Two discard alignment issues were identified in https://issues.redhat.com/browse/RHEL-86032: 1. pdiscard_alignment is not populated for host_device in file-posix.c. 2. Misaligned head/tail discard requests are not skipped when file-posix.c

Re: [PATCH 05/10] meson: Add wasm build in build scripts

2025-04-10 Thread Paolo Bonzini
On Thu, Apr 10, 2025 at 2:24 PM Kohei Tokunaga wrote: > > >> has_int128_type is set to false on emscripten as of now to avoid errors > > >> by > > >> libffi. > > > > What is the error here? How hard would it be to test for it? > > When has_int128_type=true, I encountered a runtime error from lib

[PATCH v2 0/1] hw/nvme: CMIC.MCTRS should be set automatically for multi-controller subsystems or by parameter

2025-04-10 Thread Alan Adamson
v2: - Change the parameter name from "cmic" to "cmic-mctrs". - If there is more than 1 controller in a subsystem, set CMIC.MCTRS for each controller whether or not the cmic-mctrs parameter is set. While testing Linux atomic writes with qemu-nvme v10.0.0-rc1, Linux was incorrectly displa

[PATCH v2] hw/nvme: CMIC.MCTRS should be set automatically for multi-controller subsystems or by parameter

2025-04-10 Thread Alan Adamson
If there are multiple controllers in a subsystem, CMIC.MCTRS should be set to on for all controllers. For single controller subsystems, CMIC.MCTRS will be off by default. A new subsystem specific parameter will allow setting CMIC.MCTRS for single controller subsystems. New NVMe Subsystem QEMU Para

Re: [PATCH] hw/nvme: fix attachment of private namespaces

2025-04-10 Thread Keith Busch
On Tue, Apr 08, 2025 at 12:20:46PM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > Fix regression when attaching private namespaces that gets attached to > the wrong controller. > > Keep track of the original controller "owner" of private namespaces, and > only attach if this matches on cont

[PATCH 4/6] block: Expand block status mode from bool to enum

2025-04-10 Thread Eric Blake
This patch is purely mechanical, changing bool want_zero into the new enum BlockStatusMode. As of this patch, all implementations are unchanged (the old want_zero==true is now mode==BDRV_BSTAT_PRECISE), but the callers in io.c are set up so that future patches will be able to differente between al

[PATCH 5/6] file-posix: Recognize blockdev-create file as starting all zero

2025-04-10 Thread Eric Blake
There are enough optimizations possible when a file is known to read as all zero that it is worth taking the extra time during raw_open_common() to catch more than just 100% sparse files. In particular, since our implementation of blockdev-create intentionally allocates a small all-zero block at t

[PATCH 3/6] mirror: Skip writing zeroes when target is already zero

2025-04-10 Thread Eric Blake
When mirroring, the goal is to ensure that the destination reads the same as the source; this goal is met whether the destination is sparse or fully-allocated. However, if the destination cannot efficiently write zeroes, then any time the mirror operation wants to copy zeroes from the source to th

[PATCH 6/6] tests: Add iotest mirror-sparse for recent patches

2025-04-10 Thread Eric Blake
Prove that blockdev-mirror can now result in sparse destination files. By making this a separate test, it was possible to test effects of individual patches for the various pieces that all have to work together for a sparse mirror to be successful. Signed-off-by: Eric Blake --- tests/qemu-iotest

[PATCH 1/6] mirror: Skip pre-zeroing destination if it is already zero

2025-04-10 Thread Eric Blake
When doing a sync=full mirroring, QMP drive-mirror requests full zeroing if it did not just create the destination, and blockdev-mirror requests full zeroing unconditionally. This is because during a full sync, we must ensure that the portions of the disk that are not otherwise touched by the sour

[PATCH 2/6] file-posix: Allow lseek at offset 0 when !want_zero

2025-04-10 Thread Eric Blake
The 'want_zero' parameter to raw_co_block_status() was added so that we can avoid potentially time-consuming lseek(SEEK_DATA) calls throughout the file (working around poor filesystems that have O(n) rather than O(1) extent probing). But when it comes to learning if a file is completely sparse (fo

Re: [PATCH 00/11] qapi: Documentation improvements

2025-04-10 Thread Markus Armbruster
Queued for 10.0.

Re: [PATCH v2 3/3] vhost-user: return failure if backend crash when live migration

2025-04-10 Thread Haoqian He
> 2025年4月4日 15:30,Stefano Garzarella 写道: > > On Thu, Mar 27, 2025 at 02:53:24PM +0800, Haoqian He wrote: >> >>> 2025年3月25日 17:51,Stefano Garzarella 写道: >>> >>> On Tue, Mar 25, 2025 at 04:39:46PM +0800, Haoqian He wrote: > 2025年3月24日 22:31,Stefano Garzarella 写道: > On Thu, Mar 20, 202

[PATCH v4 1/7] tests/qtest/ahci: unmap pci bar before reusing device

2025-04-10 Thread Nicholas Piggin
ahci-test double-maps the hba bar in the pending_callback test. Unmap it first, to keep iomaps balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Cc: Akihiko Odaki Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/ahci.h | 2 ++

[PATCH v4 5/7] qtest/libqos/pci: Enforce balanced iomap/unmap

2025-04-10 Thread Nicholas Piggin
Add assertions to ensure a BAR is not mapped twice, and that only previously mapped BARs are unmapped. This can help catch bugs and fragile coding. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest

[PATCH v4 6/7] qtest/libqos/pci: Fix qpci_msix_enable sharing bar0

2025-04-10 Thread Nicholas Piggin
Devices where the MSI-X addresses are shared with other MMIO on BAR0 can not use msi_enable because it unmaps and remaps BAR0, which interferes with device MMIO mappings. xhci-nec is one such device we would like to test with msix. Use the BAR iomap tracking structure introduced in the previous ch

[PATCH v4 4/7] tests/qtest/libquos/pci: Add migration fixup helper for pci devices

2025-04-10 Thread Nicholas Piggin
Migration tests can create new QPCI devices for the destination machine which may need to take on some state of the source machine after destination is complete. Add a migration fixup helper and call it from ahci migration tests. This is currently a noop and will be used subsequently. Signed-off-

[PATCH v4 2/7] tests/qtest/ahci: don't unmap pci bar if it wasn't mapped

2025-04-10 Thread Nicholas Piggin
ahci-test has a bunch of tests where the pci bar was not mapped. Avoid unmapping it in these cases, to keep iomaps balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Cc: Akihiko Odaki Cc: Akihiko Odaki Cc: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/ahci-test.c | 35

[PATCH v4 3/7] tests/qtest/libquos/virtio: unmap pci bar when disabling device

2025-04-10 Thread Nicholas Piggin
Unmap the virtio-pci bar in qvirtio_pci_disable_device() to keep iomap/iounmap balanced. Cc: Michael S. Tsirkin Cc: Marcel Apfelbaum Reviewed-by: Akihiko Odaki Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin --- tests/qtest/libqos/virtio-pci.h | 1 + tests/qtest/libqos/virtio-pci.

[PATCH v4 7/7] qtest/libqos/pci: Factor msix entry helpers into pci common code

2025-04-10 Thread Nicholas Piggin
Setting msix entry address and data and masking is moved into common code helpers from virtio tests. For now that remains the only user, but there are changes under development to enable msix vectors for msix, e1000e, and xhci tests, which can make use of them. Reviewed-by: Akihiko Odaki Signed-

[PATCH v4 0/7] qtest/libqos/pci: pci and msix fixes

2025-04-10 Thread Nicholas Piggin
Since v3: https://lore.kernel.org/qemu-devel/20250117172244.406206-1-npig...@gmail.com/ - Split out the preparation patches for the ahci and virtio tests into their own patches as suggested by Phil. - Added an extra assertion that qpci_iounmap() must only be called for a bar that was previousl

Re: [PATCH 05/10] meson: Add wasm build in build scripts

2025-04-10 Thread Kohei Tokunaga
Hi Paolo, thank you for the comments. > >> has_int128_type is set to false on emscripten as of now to avoid errors by > >> libffi. > > What is the error here? How hard would it be to test for it? When has_int128_type=true, I encountered a runtime error from libffi. To reproduce this, we need to

Re: [PATCH 00/10] Enable QEMU to run on browsers

2025-04-10 Thread Pierrick Bouvier
Hi Kohei, first, congrats for this work! It would be really nice to have this available upstream, starting with a modest TCI port, before having the tcg backend also. On 4/10/25 06:13, Kohei Tokunaga wrote: Hi Philippe, > > The biggest problem I'm seeing is we no longer support 64-bit gues

Re: [PATCH 06/11] docs/sphinx/qmp_lexer: Generalize elision syntax

2025-04-10 Thread Markus Armbruster
John Snow writes: > On Fri, Apr 4, 2025 at 8:14 AM Markus Armbruster wrote: > >> Accept "... lorem ipsum ..." in addition to "...". >> >> Signed-off-by: Markus Armbruster [...] > Cool, sure! > > ACK (Who is responsible for this now? Me?) Yup. I posted the PR without waiting for your approv