Re: [PATCH] virtio-blk: avoid using ioeventfd state in irqfd conditional

2024-01-30 Thread Stefan Hajnoczi
On Mon, 22 Jan 2024 at 12:27, Stefan Hajnoczi wrote: > > Requests that complete in an IOThread use irqfd to notify the guest > while requests that complete in the main loop thread use the traditional > qdev irq code path. The reason for this conditional is that the irq code > path requires the

[PULL 2/5] block/blkio: Make s->mem_region_alignment be 64 bits

2024-01-30 Thread Stefan Hajnoczi
From: "Richard W.M. Jones" With GCC 14 the code failed to compile on i686 (and was wrong for any version of GCC): ../block/blkio.c: In function ‘blkio_file_open’: ../block/blkio.c:857:28: error: passing argument 3 of ‘blkio_get_uint64’ from incompatible pointer type

[PULL 4/5] hw/core/qdev.c: add qdev_get_human_name()

2024-01-30 Thread Stefan Hajnoczi
From: Manos Pitsidianakis Add a simple method to return some kind of human readable identifier for use in error messages. Reviewed-by: Stefan Hajnoczi Signed-off-by: Manos Pitsidianakis Message-id: 8b566bfced98ae44be1fcc1f8e7215f0c3393aa1.1706598705.git.manos.pitsidiana...@linaro.org

[PULL 1/5] block/io_uring: improve error message when init fails

2024-01-30 Thread Stefan Hajnoczi
From: Fiona Ebner The man page for io_uring_queue_init states: > io_uring_queue_init(3) returns 0 on success and -errno on failure. and the man page for io_uring_setup (which is one of the functions where the return value of io_uring_queue_init() can come from) states: > On error, a negative

[PULL 3/5] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-01-30 Thread Stefan Hajnoczi
The following expression is incorrect because blk_pread_nonzeroes() deals in units of bytes, not sectors: bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) ^^^ BDRV_REQUEST_MAX_BYTES is the appropriate constant. Fixes: a4b15a8b9ef2

Re: [PATCH v3 0/2] hw/block/block.c: improve confusing error

2024-01-30 Thread Stefan Hajnoczi
On Tue, Jan 30, 2024 at 09:30:30AM +0200, Manos Pitsidianakis wrote: > In cases where a device tries to read more bytes than the block device > contains with the blk_check_size_and_read_all() function, the error is > vague: "device requires X bytes, block backend provides Y bytes". > > This patch

[PULL 5/5] hw/block/block.c: improve confusing blk_check_size_and_read_all() error

2024-01-30 Thread Stefan Hajnoczi
From: Manos Pitsidianakis In cases where a device tries to read more bytes than the block device contains, the error is vague: "device requires X bytes, block backend provides Y bytes". This patch changes the errors of this function to include the block backend name, the device id and device

[PULL 0/5] Block patches

2024-01-30 Thread Stefan Hajnoczi
The following changes since commit 11be70677c70fdccd452a3233653949b79e97908: Merge tag 'pull-vfio-20240129' of https://github.com/legoater/qemu into staging (2024-01-29 10:53:56 +) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-request for

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-01-30 Thread Stefan Hajnoczi
On Mon, Jan 29, 2024 at 07:27:12PM -0500, Stefan Hajnoczi wrote: > The following expression is incorrect because blk_pread_nonzeroes() > deals in units of bytes, not sectors: > > bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) > ^^^ > >

Re: [PATCH v2] block/blkio: Make s->mem_region_alignment be 64 bits

2024-01-30 Thread Stefan Hajnoczi
On Tue, Jan 30, 2024 at 12:20:01PM +, Richard W.M. Jones wrote: > With GCC 14 the code failed to compile on i686 (and was wrong for any > version of GCC): > > ../block/blkio.c: In function ‘blkio_file_open’: > ../block/blkio.c:857:28: error: passing argument 3 of ‘blkio_get_uint64’ from >

Re: [PATCH [repost]] block/blkio: Don't assume size_t is 64 bit

2024-01-30 Thread Stefan Hajnoczi
On Tue, Jan 30, 2024 at 12:19:37PM +, Richard W.M. Jones wrote: > On Tue, Jan 30, 2024 at 01:04:46PM +0100, Kevin Wolf wrote: > > Am 30.01.2024 um 11:30 hat Richard W.M. Jones geschrieben: > > > On Tue, Jan 30, 2024 at 09:51:59AM +0100, Kevin Wolf wrote: > > > > Am 29.01.2024 um 19:53 hat

[PATCH v2] block/blkio: Make s->mem_region_alignment be 64 bits

2024-01-30 Thread Richard W.M. Jones
With GCC 14 the code failed to compile on i686 (and was wrong for any version of GCC): ../block/blkio.c: In function ‘blkio_file_open’: ../block/blkio.c:857:28: error: passing argument 3 of ‘blkio_get_uint64’ from incompatible pointer type [-Wincompatible-pointer-types] 857 |

Re: [PATCH [repost]] block/blkio: Don't assume size_t is 64 bit

2024-01-30 Thread Richard W.M. Jones
On Tue, Jan 30, 2024 at 01:04:46PM +0100, Kevin Wolf wrote: > Am 30.01.2024 um 11:30 hat Richard W.M. Jones geschrieben: > > On Tue, Jan 30, 2024 at 09:51:59AM +0100, Kevin Wolf wrote: > > > Am 29.01.2024 um 19:53 hat Richard W.M. Jones geschrieben: > > > > With GCC 14 the code failed to compile

Re: [PATCH [repost]] block/blkio: Don't assume size_t is 64 bit

2024-01-30 Thread Kevin Wolf
Am 30.01.2024 um 11:30 hat Richard W.M. Jones geschrieben: > On Tue, Jan 30, 2024 at 09:51:59AM +0100, Kevin Wolf wrote: > > Am 29.01.2024 um 19:53 hat Richard W.M. Jones geschrieben: > > > With GCC 14 the code failed to compile on i686 (and was wrong for any > > > version of GCC): > > > > > >

Re: [PATCH [repost]] block/blkio: Don't assume size_t is 64 bit

2024-01-30 Thread Richard W.M. Jones
On Tue, Jan 30, 2024 at 09:51:59AM +0100, Kevin Wolf wrote: > Am 29.01.2024 um 19:53 hat Richard W.M. Jones geschrieben: > > With GCC 14 the code failed to compile on i686 (and was wrong for any > > version of GCC): > > > > ../block/blkio.c: In function ‘blkio_file_open’: > >

Re: [PATCH v3 6/6] hw/xen: convert stderr prints to error/warn reports

2024-01-30 Thread Alex Bennée
Manos Pitsidianakis writes: > According to the QEMU Coding Style document: > >> Do not use printf(), fprintf() or monitor_printf(). Instead, use >> error_report() or error_vreport() from error-report.h. This ensures the >> error is reported in the right place (current monitor or stderr), and in

Re: [PATCH v3 5/6] hw/xen/xen-hvm-common.c: convert DPRINTF to tracepoints

2024-01-30 Thread Alex Bennée
Manos Pitsidianakis writes: > Tracing DPRINTFs to stderr might not be desired. A developer that relies > on tracepoints should be able to opt-in to each tracepoint and rely on > QEMU's log redirection, instead of stderr by default. > > This commit converts DPRINTFs in this file that are used for

Re: [PATCH v3 4/6] hw/xen/xen-mapcache.c: convert DPRINTF to tracepoints

2024-01-30 Thread Alex Bennée
Manos Pitsidianakis writes: > Tracing DPRINTFs to stderr might not be desired. A developer that relies > on tracepoints should be able to opt-in to each tracepoint and rely on > QEMU's log redirection, instead of stderr by default. > > This commit converts DPRINTFs in this file that are used for

Re: [PATCH v3 3/6] hw/arm/xen_arm.c: convert DPRINTF to trace events and error/warn reports

2024-01-30 Thread Alex Bennée
Manos Pitsidianakis writes: > Tracing DPRINTFs to stderr might not be desired. A developer that relies > on trace events should be able to opt-in to each trace event and rely on > QEMU's log redirection, instead of stderr by default. > > This commit converts DPRINTFs in this file that are used

Re: [PATCH v3 2/6] hw/arm/z2: convert DPRINTF to trace events and guest errors

2024-01-30 Thread Alex Bennée
Manos Pitsidianakis writes: > Tracing DPRINTFs to stderr might not be desired. A developer that relies > on trace events should be able to opt-in to each trace event and rely on > QEMU's log redirection, instead of stderr by default. > > This commit converts DPRINTFs in this file that are used

Re: [PATCH] hw/hyperv: Include missing headers

2024-01-30 Thread Manos Pitsidianakis
On Mon, 29 Jan 2024 19:00, Philippe Mathieu-Daudé wrote: Include missing headers in order to avoid when refactoring unrelated headers: hw/hyperv/hyperv.c:33:18: error: field ‘msg_page_mr’ has incomplete type 33 | MemoryRegion msg_page_mr; | ^~~

[PATCH v3] blockcommit: Reopen base image as RO after abort

2024-01-30 Thread Alexander Ivanov
If a blockcommit is aborted the base image remains in RW mode, that leads to a fail of subsequent live migration. How to reproduce: $ virsh snapshot-create-as vm snp1 --disk-only *** write something to the disk inside the guest *** $ virsh blockcommit vm vda --active --shallow && virsh

Re: [PATCH [repost]] block/blkio: Don't assume size_t is 64 bit

2024-01-30 Thread Kevin Wolf
Am 29.01.2024 um 19:53 hat Richard W.M. Jones geschrieben: > With GCC 14 the code failed to compile on i686 (and was wrong for any > version of GCC): > > ../block/blkio.c: In function ‘blkio_file_open’: > ../block/blkio.c:857:28: error: passing argument 3 of ‘blkio_get_uint64’ from >

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-01-30 Thread Philippe Mathieu-Daudé
On 30/1/24 01:27, Stefan Hajnoczi wrote: The following expression is incorrect because blk_pread_nonzeroes() deals in units of bytes, not sectors: bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) ^^^ BDRV_REQUEST_MAX_BYTES is the