Re: Suspicious QOM types without instance/class size

2020-08-21 Thread Eduardo Habkost
On Fri, Aug 21, 2020 at 11:43:35AM +0200, Cornelia Huck wrote: > On Thu, 20 Aug 2020 17:55:29 -0400 > Eduardo Habkost wrote: > > > While trying to convert TypeInfo declarations to the new > > OBJECT_DECLARE* macros, I've stumbled on a few suspicious cases > > where instance_size or class_size is

[PATCH v6 15/15] block/nvme: Use an array of EventNotifier

2020-08-21 Thread Philippe Mathieu-Daudé
In preparation of using multiple IRQ (thus multiple eventfds) make BDRVNVMeState::irq_notifier an array (for now of a single element, the admin queue notifier). Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 31

[PATCH v6 12/15] block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE

2020-08-21 Thread Philippe Mathieu-Daudé
BDRV_POLL_WHILE() is defined as: #define BDRV_POLL_WHILE(bs, cond) ({ \ BlockDriverState *bs_ = (bs); \ AIO_WAIT_WHILE(bdrv_get_aio_context(bs_), \ cond); }) As we will remove the BlockDriverState use in the next commit, start by using the

[PATCH v6 14/15] block/nvme: Extract nvme_poll_queue()

2020-08-21 Thread Philippe Mathieu-Daudé
As we want to do per-queue polling, extract the nvme_poll_queue() method which operates on a single queue. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 44 +++- 1 file changed, 27

[PATCH v6 13/15] block/nvme: Simplify nvme_create_queue_pair() arguments

2020-08-21 Thread Philippe Mathieu-Daudé
nvme_create_queue_pair() doesn't require BlockDriverState anymore. Replace it by BDRVNVMeState and AioContext to simplify. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 13 +++-- 1 file changed, 7 insertions(+), 6

[PATCH v6 09/15] block/nvme: Replace qemu_try_blockalign0 by qemu_try_blockalign/memset

2020-08-21 Thread Philippe Mathieu-Daudé
In the next commit we'll get rid of qemu_try_blockalign(). To ease review, first replace qemu_try_blockalign0() by explicit calls to qemu_try_blockalign() and memset(). Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 16

[PATCH v6 11/15] block/nvme: Simplify nvme_init_queue() arguments

2020-08-21 Thread Philippe Mathieu-Daudé
nvme_init_queue() doesn't require BlockDriverState anymore. Replace it by BDRVNVMeState to simplify. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH v6 10/15] block/nvme: Replace qemu_try_blockalign(bs) by qemu_try_memalign(pg_sz)

2020-08-21 Thread Philippe Mathieu-Daudé
qemu_try_blockalign() is a generic API that call back to the block driver to return its page alignment. As we call from within the very same driver, we already know to page alignment stored in our state. Remove indirections and use the value from BDRVNVMeState. This change is required to later

[PATCH v6 08/15] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures

2020-08-21 Thread Philippe Mathieu-Daudé
We allocate an unique chunk of memory then use it for two different structures. By using an union, we make it clear the data is overlapping (and we can remove the casts). Suggested-by: Stefan Hajnoczi Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe

[PATCH v6 06/15] block/nvme: Use common error path in nvme_add_io_queue()

2020-08-21 Thread Philippe Mathieu-Daudé
Rearrange nvme_add_io_queue() by using a common error path. This will be proven useful in few commits where we add IRQ notification to the IO queues. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 9 + 1 file

[PATCH v6 07/15] block/nvme: Rename local variable

2020-08-21 Thread Philippe Mathieu-Daudé
We are going to modify the code in the next commit. Renaming the 'resp' variable to 'id' first makes the next commit easier to review. No logical changes. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 19

[PATCH v6 04/15] block/nvme: Define INDEX macros to ease code review

2020-08-21 Thread Philippe Mathieu-Daudé
Use definitions instead of '0' or '1' indexes. Also this will be useful when using multi-queues later. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 33 +++-- 1 file changed, 19 insertions(+),

[PATCH v6 02/15] block/nvme: Avoid further processing if trace event not enabled

2020-08-21 Thread Philippe Mathieu-Daudé
Avoid further processing if TRACE_NVME_SUBMIT_COMMAND_RAW is not enabled. This is an untested intend of performance optimization. Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/nvme.c

[PATCH v6 03/15] block/nvme: Let nvme_create_queue_pair() fail gracefully

2020-08-21 Thread Philippe Mathieu-Daudé
As nvme_create_queue_pair() is allowed to fail, replace the alloc() calls by try_alloc() to avoid aborting QEMU. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 12 ++-- 1 file changed, 10 insertions(+), 2

[PATCH v6 05/15] block/nvme: Improve error message when IO queue creation failed

2020-08-21 Thread Philippe Mathieu-Daudé
Do not use the same error message for different failures. Display a different error whether it is the CQ or the SQ. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v6 01/15] block/nvme: Replace magic value by SCALE_MS definition

2020-08-21 Thread Philippe Mathieu-Daudé
Use self-explicit SCALE_MS definition instead of magic value. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index

[PATCH v6 00/15] block/nvme: Various cleanups required to use multiple queues

2020-08-21 Thread Philippe Mathieu-Daudé
Hi Kevin, This series is mostly code rearrangement (cleanups) to be able to split the hardware code from the block driver code, to be able to use multiple queues on the same hardware, or multiple block drivers on the same hardware. All this series is reviewed. Since v5: - audit rebase on

Re: [PULL 0/3] Block patches

2020-08-21 Thread Peter Maydell
On Mon, 17 Aug 2020 at 16:16, Stefan Hajnoczi wrote: > > The following changes since commit d0ed6a69d399ae193959225cdeaa9382746c91cc: > > Update version for v5.1.0 release (2020-08-11 17:07:03 +0100) > > are available in the Git repository at: > > https://github.com/stefanha/qemu.git

Re: Suspicious QOM types without instance/class size

2020-08-21 Thread Eduardo Habkost
On Fri, Aug 21, 2020 at 11:40:12AM +0200, David Hildenbrand wrote: > On 20.08.20 23:55, Eduardo Habkost wrote: > > While trying to convert TypeInfo declarations to the new > > OBJECT_DECLARE* macros, I've stumbled on a few suspicious cases > > where instance_size or class_size is not set, despite

Re: Suspicious QOM types without instance/class size

2020-08-21 Thread Eduardo Habkost
On Fri, Aug 21, 2020 at 11:47:32AM +1000, David Gibson wrote: > On Thu, Aug 20, 2020 at 05:55:29PM -0400, Eduardo Habkost wrote: > > While trying to convert TypeInfo declarations to the new > > OBJECT_DECLARE* macros, I've stumbled on a few suspicious cases > > where instance_size or class_size is

Re: Suspicious QOM types without instance/class size

2020-08-21 Thread Eduardo Habkost
On Fri, Aug 21, 2020 at 01:29:38PM -0400, Eduardo Habkost wrote: > On Fri, Aug 21, 2020 at 01:53:52PM +0300, Roman Bolshakov wrote: > > On Thu, Aug 20, 2020 at 05:55:29PM -0400, Eduardo Habkost wrote: > > > While trying to convert TypeInfo declarations to the new > > > OBJECT_DECLARE* macros, I've

[PULL 17/23] hw/sd: Rename sdbus_read_data() as sdbus_read_byte()

2020-08-21 Thread Philippe Mathieu-Daudé
The sdbus_read_data() method do a single byte access on the data line of a SD bus. Rename it as sdbus_read_byte() and document it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200814092346.21825-4-f4...@amsat.org> --- include/hw/sd/sd.h| 10

[PULL 21/23] hw/sd: Use sdbus_read_data() instead of sdbus_read_byte() when possible

2020-08-21 Thread Philippe Mathieu-Daudé
Use the recently added sdbus_read_data() to read multiple bytes at once, instead of looping calling sdbus_read_byte(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200814092346.21825-8-f4...@amsat.org> --- hw/sd/allwinner-sdhost.c | 10 +++---

[PULL 22/23] hw/sd: Fix incorrect populated function switch status data structure

2020-08-21 Thread Philippe Mathieu-Daudé
From: Bin Meng At present the function switch status data structure bit [399:376] are wrongly pupulated. These 3 bytes encode function switch status for the 6 function groups, with 4 bits per group, starting from function group 6 at bit 399, then followed by function group 5 at bit 395, and so

Re: Suspicious QOM types without instance/class size

2020-08-21 Thread Eduardo Habkost
On Fri, Aug 21, 2020 at 01:53:52PM +0300, Roman Bolshakov wrote: > On Thu, Aug 20, 2020 at 05:55:29PM -0400, Eduardo Habkost wrote: > > While trying to convert TypeInfo declarations to the new > > OBJECT_DECLARE* macros, I've stumbled on a few suspicious cases > > where instance_size or class_size

[PULL 19/23] hw/sd: Use sdbus_write_data() instead of sdbus_write_byte when possible

2020-08-21 Thread Philippe Mathieu-Daudé
Use the recently added sdbus_write_data() to write multiple bytes at once, instead of looping calling sdbus_write_byte(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200814092346.21825-6-f4...@amsat.org> --- hw/sd/allwinner-sdhost.c | 14 +-

[PULL 12/23] hw/sd/pl181: Replace disabled fprintf()s by trace events

2020-08-21 Thread Philippe Mathieu-Daudé
Convert disabled DPRINTF() to trace events and remove ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Acked-by: Peter Maydell Message-Id: <20200705204630.4133-9-f4...@amsat.org> --- hw/sd/pl181.c | 26 +- hw/sd/trace-events | 10

[PULL 20/23] hw/sd: Add sdbus_read_data() to read multiples bytes on the data line

2020-08-21 Thread Philippe Mathieu-Daudé
Add a sdbus_read_data() method to read multiple bytes on the data line of a SD bus. We might improve the tracing later, for now keep logging each byte individually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200814092346.21825-7-f4...@amsat.org> ---

[PULL 15/23] hw/sd: Rename read/write_data() as read/write_byte()

2020-08-21 Thread Philippe Mathieu-Daudé
The read/write_data() methods write do a single byte access on the data line of a SD card. Rename them as read/write_byte(). Add some documentation (not in "hw/sd/sdcard_legacy.h" which we are going to remove soon). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson

[PULL 18/23] hw/sd: Add sdbus_write_data() to write multiples bytes on the data line

2020-08-21 Thread Philippe Mathieu-Daudé
Add a sdbus_write_data() method to write multiple bytes on the data line of a SD bus. We might improve the tracing later, for now keep logging each byte individually. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200814092346.21825-5-f4...@amsat.org> ---

[PULL 16/23] hw/sd: Rename sdbus_write_data() as sdbus_write_byte()

2020-08-21 Thread Philippe Mathieu-Daudé
The sdbus_write_data() method do a single byte access on the data line of a SD bus. Rename it as sdbus_write_byte() and document it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200814092346.21825-3-f4...@amsat.org> --- include/hw/sd/sd.h| 9

[PULL 08/23] hw/sd/pl181: Add TODO to use Fifo32 API

2020-08-21 Thread Philippe Mathieu-Daudé
Add TODO to use Fifo32 API from "qemu/fifo32.h". Signed-off-by: Philippe Mathieu-Daudé Acked-by: Peter Maydell Message-Id: <20200705204630.4133-4-f4...@amsat.org> --- hw/sd/pl181.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index

[PULL 07/23] hw/sd/pl181: Rename pl181_send_command() as pl181_do_command()

2020-08-21 Thread Philippe Mathieu-Daudé
pl181_send_command() do a bus transaction (send or receive), rename it as pl181_do_command(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Acked-by: Peter Maydell Message-Id: <20200705204630.4133-3-f4...@amsat.org> --- hw/sd/pl181.c | 4 ++-- 1 file changed, 2

[PULL 09/23] hw/sd/pl181: Use named GPIOs

2020-08-21 Thread Philippe Mathieu-Daudé
To make the code easier to manage/review/use, rename the cardstatus[0] variable as 'card_readonly' and name the GPIO "card-read-only". Similarly with cardstatus[1], renamed as 'card_inserted' and name its GPIO "card-inserted". Adapt the users accordingly by using the qdev_init_gpio_out_named()

[PULL 05/23] hw/sd/milkymist: Do not create SD card within the SD host controller

2020-08-21 Thread Philippe Mathieu-Daudé
SD/MMC host controllers provide a SD Bus to plug SD cards, but don't come with SD card plugged in :) Let the machine/board model create and plug the SD cards when required. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20200705211016.15241-5-f4...@amsat.org>

[PULL 06/23] hw/sd/pl181: Replace fprintf(stderr, "*\n") with error_report()

2020-08-21 Thread Philippe Mathieu-Daudé
From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr,

[PULL 04/23] hw/sd/milkymist: Create the SDBus at init()

2020-08-21 Thread Philippe Mathieu-Daudé
We don't need to wait until realize() to create the SDBus, create it in init() directly. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20200705211016.15241-4-f4...@amsat.org> --- hw/sd/milkymist-memcard.c | 6 +++--- 1 file changed, 3 insertions(+), 3

[PULL 03/23] hw/lm32/milkymist: Un-inline milkymist_memcard_create()

2020-08-21 Thread Philippe Mathieu-Daudé
As we will modify milkymist_memcard_create(), move it first to the source file where it is used. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20200705211016.15241-2-f4...@amsat.org> --- hw/lm32/milkymist-hw.h | 11 --- hw/lm32/milkymist.c| 11

[PULL 02/23] hw/sd/pxa2xx_mmci: Trivial simplification

2020-08-21 Thread Philippe Mathieu-Daudé
Avoid declaring PXA2xxMMCIState local variable, return it directly. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Laurent Vivier Acked-by: Peter Maydell Message-Id: <20200705213350.24725-3-f4...@amsat.org> --- hw/sd/pxa2xx_mmci.c | 4 +--- 1 file changed, 1

[PULL 23/23] hw/sd: Correct the maximum size of a Standard Capacity SD Memory Card

2020-08-21 Thread Philippe Mathieu-Daudé
From: Bin Meng Per the SD spec, Standard Capacity SD Memory Card (SDSC) supports capacity up to and including 2 GiB. Fixes: 2d7adea4fe ("hw/sd: Support SDHC size cards") Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé Tested-by: Sai Pavan Boddu Message-Id:

[PULL 14/23] hw/sd: Move sdcard legacy API to 'hw/sd/sdcard_legacy.h'

2020-08-21 Thread Philippe Mathieu-Daudé
omap_mmc.c is the last device left using the legacy sdcard API. Move the prototype declarations into a separate header, to make it clear this is a legacy API. Reviewed-by: Alistair Francis Message-Id: <20180216022933.10945-8-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé Acked-by: Peter

[PULL 13/23] hw/sd/sdcard: Make sd_data_ready() static

2020-08-21 Thread Philippe Mathieu-Daudé
sd_data_ready() belongs to the legacy API. As its last user has been converted to the SDBus API, make it static. Reviewed-by: Alistair Francis Message-Id: <20180216022933.10945-7-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé Acked-by: Peter Maydell --- include/hw/sd/sd.h | 1 -

[PULL 00/23] SD/MMC patches for 2020-08-21

2020-08-21 Thread Philippe Mathieu-Daudé
-next-20200821 for you to fetch changes up to 6d2d4069c47e23b9e3913f9c8204fd0edcb99fb3: hw/sd: Correct the maximum size of a Standard Capacity SD Memory Card (2020= -08-21 16:49:22 +0200) SD/MMC patches - Convert legacy SD host

[PULL 11/23] hw/sd/pl181: Do not create SD card within the SD host controller

2020-08-21 Thread Philippe Mathieu-Daudé
SD/MMC host controllers provide a SD Bus to plug SD cards, but don't come with SD card plugged in :) Let the machine/board model create and plug the SD cards when required. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Peter Maydell Acked-by: Peter Maydell

[PULL 10/23] hw/sd/pl181: Expose a SDBus and connect the SDCard to it

2020-08-21 Thread Philippe Mathieu-Daudé
Convert the controller to the SDBus API: - add the a TYPE_PL181_BUS object of type TYPE_SD_BUS, - adapt the SDBusClass set_inserted/set_readonly handlers - create the bus in the PL181 controller - switch legacy sd_*() API to the sdbus_*() API. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by:

Re: [PATCH v5 08/10] iotests.py: add verify_o_direct helper

2020-08-21 Thread Nir Soffer
On Fri, Aug 21, 2020 at 5:12 PM Vladimir Sementsov-Ogievskiy wrote: > > Add python notrun-helper similar to _check_o_direct for bash tests. > To be used in the following commit. > > Suggested-by: Nir Soffer > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > tests/qemu-iotests/iotests.py |

[PULL 01/23] hw/sd/pxa2xx_mmci: Do not create SD card within the SD host controller

2020-08-21 Thread Philippe Mathieu-Daudé
SD/MMC host controllers provide a SD Bus to plug SD cards, but don't come with SD card plugged in :) The machine/board object is where the SD cards are created. Since the PXA2xx is not qdevified, for now create the cards in pxa270_init() which is the SoC model. In the future we will move this to

[PATCH v4 4/6] util: introduce qemu_open and qemu_create with error reporting

2020-08-21 Thread Daniel P . Berrangé
qemu_open_old() works like open(): set errno and return -1 on failure. It has even more failure modes, though. Reporting the error clearly to users is basically impossible for many of them. Our standard cure for "errno is too coarse" is the Error object. Introduce two new helper methods: int

[PATCH v4 5/6] util: give a specific error message when O_DIRECT doesn't work

2020-08-21 Thread Daniel P . Berrangé
A common error scenario is to tell QEMU to use O_DIRECT in combination with a filesystem that doesn't support it. To aid users to diagnosing their mistake we want to provide a clear error message when this happens. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrangé --- util/osdep.c | 13

[PATCH v4 6/6] block/fileb: switch to use qemu_open/qemu_create for improved errors

2020-08-21 Thread Daniel P . Berrangé
Currently at startup if using cache=none on a filesystem lacking O_DIRECT such as tmpfs, at startup QEMU prints qemu-system-x86_64: -drive file=/tmp/foo.img,cache=none: file system may not support O_DIRECT qemu-system-x86_64: -drive file=/tmp/foo.img,cache=none: Could not open '/tmp/foo.img':

[PATCH v4 1/6] util: rename qemu_open() to qemu_open_old()

2020-08-21 Thread Daniel P . Berrangé
We want to introduce a new version of qemu_open() that uses an Error object for reporting problems and make this it the preferred interface. Rename the existing method to release the namespace for the new impl. Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P.

[PATCH v4 2/6] util: refactor qemu_open_old to split off variadic args handling

2020-08-21 Thread Daniel P . Berrangé
This simple refactoring prepares for future patches. The variadic args handling is split from the main bulk of the open logic. The duplicated calls to open() are removed in favour of updating the "flags" variable to have O_CLOEXEC. Signed-off-by: Daniel P. Berrangé --- util/osdep.c | 40

[PATCH v4 0/6] block: improve error reporting for unsupported O_DIRECT

2020-08-21 Thread Daniel P . Berrangé
v1: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg00269.html v2: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg00589.html v3: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg07098.html See patch commit messages for rationale Ideally we would convert other callers

[PATCH v4 3/6] util: add Error object for qemu_open_internal error reporting

2020-08-21 Thread Daniel P . Berrangé
Instead of relying on the limited information from errno, we can now also provide detailed error messages. Signed-off-by: Daniel P. Berrangé --- util/osdep.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/util/osdep.c b/util/osdep.c index

Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster

2020-08-21 Thread Brian Foster
On Fri, Aug 21, 2020 at 02:12:32PM +0200, Alberto Garcia wrote: > On Fri 21 Aug 2020 01:42:52 PM CEST, Alberto Garcia wrote: > > On Fri 21 Aug 2020 01:05:06 PM CEST, Brian Foster > > wrote: > >>> > 1) off: for every write request QEMU initializes the cluster (64KB) > >>> > with

Re: [PATCH] util/meson.build: fix fdmon-io_uring build

2020-08-21 Thread Stefano Garzarella
On Fri, Aug 21, 2020 at 06:46:15PM +0200, Philippe Mathieu-Daudé wrote: > On 8/21/20 6:23 PM, Stefano Garzarella wrote: > > On Fri, Aug 21, 2020 at 06:12:45PM +0200, Philippe Mathieu-Daudé wrote: > >> Hi Stefano, > >> > >> On 8/21/20 5:48 PM, Stefano Garzarella wrote: > >>> libqemuutil.a build

Re: [PATCH] util/meson.build: fix fdmon-io_uring build

2020-08-21 Thread Philippe Mathieu-Daudé
On 8/21/20 6:23 PM, Stefano Garzarella wrote: > On Fri, Aug 21, 2020 at 06:12:45PM +0200, Philippe Mathieu-Daudé wrote: >> Hi Stefano, >> >> On 8/21/20 5:48 PM, Stefano Garzarella wrote: >>> libqemuutil.a build fails with this error: >>> >>> /usr/bin/ld:

Re: Suspicious QOM types without instance/class size

2020-08-21 Thread Eduardo Habkost
On Fri, Aug 21, 2020 at 09:06:51AM -0700, Alistair Francis wrote: > On Thu, Aug 20, 2020 at 2:56 PM Eduardo Habkost wrote: > > > > While trying to convert TypeInfo declarations to the new > > OBJECT_DECLARE* macros, I've stumbled on a few suspicious cases > > where instance_size or class_size is

Re: [PATCH v2 (BROKEN) 0/6] migration: bring improved savevm/loadvm/delvm to QMP

2020-08-21 Thread Daniel P . Berrangé
On Mon, Jul 27, 2020 at 04:08:37PM +0100, Daniel P. Berrangé wrote: > A followup to: > > v1: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg00866.html snip > HELP NEEDED: this series starts to implement the approach that Kevin > suggested wrto use of generic jobs. > > When I try to

Re: [PULL 0/9] Tracing patches

2020-08-21 Thread Peter Maydell
On Thu, 13 Aug 2020 at 08:44, Stefan Hajnoczi wrote: > > The following changes since commit d0ed6a69d399ae193959225cdeaa9382746c91cc: > > Update version for v5.1.0 release (2020-08-11 17:07:03 +0100) > > are available in the Git repository at: > > https://github.com/stefanha/qemu.git

Re: [PATCH] util/meson.build: fix fdmon-io_uring build

2020-08-21 Thread Stefano Garzarella
On Fri, Aug 21, 2020 at 06:12:45PM +0200, Philippe Mathieu-Daudé wrote: > Hi Stefano, > > On 8/21/20 5:48 PM, Stefano Garzarella wrote: > > libqemuutil.a build fails with this error: > > > > /usr/bin/ld: libqemuutil.a(util_fdmon-io_uring.c.o): in function > > `get_sqe': > >

Re: Suspicious QOM types without instance/class size

2020-08-21 Thread Alistair Francis
On Thu, Aug 20, 2020 at 2:56 PM Eduardo Habkost wrote: > > While trying to convert TypeInfo declarations to the new > OBJECT_DECLARE* macros, I've stumbled on a few suspicious cases > where instance_size or class_size is not set, despite having type > checker macros that use a specific type. > >

Re: [PATCH] util/meson.build: fix fdmon-io_uring build

2020-08-21 Thread Philippe Mathieu-Daudé
Hi Stefano, On 8/21/20 5:48 PM, Stefano Garzarella wrote: > libqemuutil.a build fails with this error: > > /usr/bin/ld: libqemuutil.a(util_fdmon-io_uring.c.o): in function `get_sqe': > qemu/build/../util/fdmon-io_uring.c:83: undefined reference to > `io_uring_get_sqe' > /usr/bin/ld:

Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster

2020-08-21 Thread Alberto Garcia
On Thu 20 Aug 2020 11:58:11 PM CEST, Dave Chinner wrote: >> The virtual drive (/dev/vdb) is a freshly created qcow2 file stored on >> the host (on an xfs or ext4 filesystem as the table above shows), and >> it is attached to QEMU using a virtio-blk-pci device: >> >>-drive

Re: [PATCH 0/1] qcow2: Skip copy-on-write when allocating a zero cluster

2020-08-21 Thread Alberto Garcia
On Fri 21 Aug 2020 02:59:44 PM CEST, Brian Foster wrote: >> > Option 4 is described above as initial file preallocation whereas >> > option 1 is per 64k cluster prealloc. Prealloc mode mixup aside, Berto >> > is reporting that the initial file preallocation mode is slower than >> > the per cluster

Re: [PATCH v7 39/47] blockdev: Fix active commit choice

2020-08-21 Thread Kevin Wolf
Am 25.06.2020 um 17:22 hat Max Reitz geschrieben: > We have to perform an active commit whenever the top node has a parent > that has taken the WRITE permission on it. > > Signed-off-by: Max Reitz > Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > blockdev.c | 24 +--- > 1

[PATCH] util/meson.build: fix fdmon-io_uring build

2020-08-21 Thread Stefano Garzarella
libqemuutil.a build fails with this error: /usr/bin/ld: libqemuutil.a(util_fdmon-io_uring.c.o): in function `get_sqe': qemu/build/../util/fdmon-io_uring.c:83: undefined reference to `io_uring_get_sqe' /usr/bin/ld: qemu/build/../util/fdmon-io_uring.c:92: undefined reference to

Re: [PATCH v7 37/47] qemu-img: Use child access functions

2020-08-21 Thread Kevin Wolf
Am 25.06.2020 um 17:22 hat Max Reitz geschrieben: > This changes iotest 204's output, because blkdebug on top of a COW node > used to make qemu-img map disregard the rest of the backing chain (the > backing chain was broken by the filter). With this patch, the > allocation in the base image is

[PATCH v3 2/2] hw/sd: sd: Correct the maximum size of a Standard Capacity SD Memory Card

2020-08-21 Thread Bin Meng
From: Bin Meng Per the SD spec, Standard Capacity SD Memory Card (SDSC) supports capacity up to and including 2 GiB. Fixes: 2d7adea4fe ("hw/sd: Support SDHC size cards") Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé Tested-by: Sai Pavan Boddu --- Changes in v3: - add

[PATCH v3 1/2] hw/sd: sd: Fix incorrect populated function switch status data structure

2020-08-21 Thread Bin Meng
From: Bin Meng At present the function switch status data structure bit [399:376] are wrongly pupulated. These 3 bytes encode function switch status for the 6 function groups, with 4 bits per group, starting from function group 6 at bit 399, then followed by function group 5 at bit 395, and so

Re: [PATCH 0/7] hw/sd: Use sdbus_read_data/sdbus_write_data for multiple bytes access

2020-08-21 Thread Philippe Mathieu-Daudé
On 8/14/20 11:23 AM, Philippe Mathieu-Daudé wrote: > Introduce sdbus_read_data() and sdbus_write_data() methods to > access multiple bytes on the data line of a SD bus. > > I haven't named then sdbus_access_block() because I expect a > block to be a power of 2, while there is no such restriction

Re: [PATCH v2 0/3] hw/sd: Add Cadence SDHCI emulation

2020-08-21 Thread Bin Meng
Hi Philippe, On Fri, Aug 21, 2020 at 10:21 PM Philippe Mathieu-Daudé wrote: > > Hi Bin, > > On 8/21/20 2:54 AM, Bin Meng wrote: > > Hi Philippe, > > > > On Fri, Aug 21, 2020 at 2:04 AM Philippe Mathieu-Daudé > > wrote: > >> > >> Hi Sai Pavan, you said you were interested to test the first 2 >

Re: [PATCH v2 0/3] hw/sd: Add Cadence SDHCI emulation

2020-08-21 Thread Philippe Mathieu-Daudé
Hi Bin, On 8/21/20 2:54 AM, Bin Meng wrote: > Hi Philippe, > > On Fri, Aug 21, 2020 at 2:04 AM Philippe Mathieu-Daudé > wrote: >> >> Hi Sai Pavan, you said you were interested to test the first 2 >> patches. FYI I plan to queue them and send the pull request tomorrow >> or Saturday the latest.

[PATCH v5 10/10] iotests: add 298 to test new preallocate filter driver

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/298 | 50 ++ tests/qemu-iotests/298.out | 6 + tests/qemu-iotests/group | 1 + 3 files changed, 57 insertions(+) create mode 100644

[PATCH v5 09/10] iotests.py: add filter_img_check

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
Add analog of bash _filter_qemu_img_check to python framework. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/iotests.py | 4 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index

[PATCH v5 08/10] iotests.py: add verify_o_direct helper

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
Add python notrun-helper similar to _check_o_direct for bash tests. To be used in the following commit. Suggested-by: Nir Soffer Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 12 1 file changed, 12 insertions(+) diff --git

[PATCH v5 04/10] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
bs is linked in req, so no needs to pass it separately. Most of tracked-requests API doesn't have bs argument. Actually, after this patch only tracked_request_begin has it, but it's for purpose. While being here, also add a comment about what "_locked" is. Signed-off-by: Vladimir

[PATCH v5 03/10] block/io: split out bdrv_find_conflicting_request

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
To be reused in separate. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi --- block/io.c | 71 +++--- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/block/io.c b/block/io.c index b18680a842..5b96715058

[PATCH v5 05/10] block: bdrv_mark_request_serialising: split non-waiting function

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
We'll need a separate function, which will only "mark" request serialising with specified align but not wait for conflicting requests. So, it will be like old bdrv_mark_request_serialising(), before merging bdrv_wait_serialising_requests_locked() into it. To reduce the possible mess, let's do the

[PULL 09/14] qcow2_format.py: collect fields to dump in JSON format

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich As __dict__ is being extended with class members we do not want to print, add the to_json() method to classes that returns a json-dumpable object with desired fields and their values. Extend it in subclass when necessary to print the final dictionary in the JSON output

[PATCH v5 07/10] block: introduce preallocate filter

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
It's intended to be inserted between format and protocol nodes to preallocate additional space (expanding protocol file) on writes crossing EOF. It improves performance for file-systems with slow allocation. Signed-off-by: Vladimir Sementsov-Ogievskiy --- docs/system/qemu-block-drivers.rst.inc

[PATCH v5 02/10] block/io.c: drop assertion on double waiting for request serialisation

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
The comments states, that on misaligned request we should have already been waiting. But for bdrv_padding_rmw_read, we called bdrv_mark_request_serialising with align = request_alignment, and now we serialise with align = cluster_size. So we may have to wait again with larger alignment. Note,

[PATCH v5 06/10] block: introduce BDRV_REQ_NO_WAIT flag

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
Add flag to make serialising request no wait: if there are conflicting requests, just return error immediately. It's will be used in upcoming preallocate filter. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block.h | 9 - block/io.c| 11 ++- 2 files

[PULL 14/14] iotests: Test node/bitmap aliases during migration

2020-08-21 Thread Eric Blake
From: Max Reitz Signed-off-by: Max Reitz Message-Id: <20200820150725.68687-4-mre...@redhat.com> Reviewed-by: Eric Blake Tested-by: Eric Blake [eblake: fold in python cleanups recommended by Vladimir] Signed-off-by: Eric Blake --- tests/qemu-iotests/300 | 593

[PULL 13/14] iotests.py: Let wait_migration() return on failure

2020-08-21 Thread Eric Blake
From: Max Reitz Let wait_migration() return on failure (with the return value indicating whether the migration was completed or has failed), so we can use it for migrations that are expected to fail, too. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Vladimir

[PULL 07/14] qcow2_format.py: Dump bitmap table serialized entries

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich Add bitmap table information to the QCOW2 metadata dump. Bitmap name bitmap-1 ... Bitmap table typesize offset 0 serialized 6553610092544 1 all-zeroes 00 2 all-zeroes

[PULL 11/14] iotests: dump QCOW2 header in JSON in #303

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich Extend the test case #303 by dumping QCOW2 image metadata in JSON format. Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <1596742557-320265-12-git-send-email-andrey.shinkev...@virtuozzo.com> Signed-off-by: Eric Blake ---

[PATCH v5 00/10] preallocate filter

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here is a filter, which does preallocation on write. In Virtuozzo we have to deal with some custom distributed storage solution, where allocation is relatively expensive operation. We have to workaround it in Qemu, so here is a new filter. v5: rewrite patch 08 as Nir suggested v4:

[PATCH v5 01/10] block: simplify comment to BDRV_REQ_SERIALISING

2020-08-21 Thread Vladimir Sementsov-Ogievskiy
1. BDRV_REQ_NO_SERIALISING doesn't exist already, don't mention it. 2. We are going to add one more user of BDRV_REQ_SERIALISING, so comment about backup becomes a bit confusing here. The use case in backup is documented in block/backup.c, so let's just drop duplication here. 3. The

[PULL 08/14] qcow2.py: Introduce '-j' key to dump in JSON format

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich Add the command key to the qcow2.py arguments list to dump QCOW2 metadata in JSON format. Here is the suggested way to do that. The implementation of the dump in JSON format is in the patch that follows. Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir

[PULL 06/14] qcow2_format.py: pass cluster size to substructures

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich The cluster size of an image is the QcowHeader class member and may be obtained by dependent extension structures such as Qcow2BitmapExt for further bitmap table details print. Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id:

[PULL 01/14] iotests: add test for QCOW2 header dump

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich The simple script creates a QCOW2 image and fills it with some data. Two bitmaps are created as well. Then the script reads the image header with extensions from the disk by running the script qcow2.py and dumps the information to the output. Other entities, such as

[PULL 04/14] qcow2_format.py: dump bitmap flags in human readable way.

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich Introduce the class BitmapFlags that parses a bitmap flags mask. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <1596742557-320265-5-git-send-email-andrey.shinkev...@virtuozzo.com>

[PULL 12/14] migration: Add block-bitmap-mapping parameter

2020-08-21 Thread Eric Blake
From: Max Reitz This migration parameter allows mapping block node names and bitmap names to aliases for the purpose of block dirty bitmap migration. This way, management tools can use different node and bitmap names on the source and destination and pass the mapping of how bitmaps are to be

[PULL 03/14] qcow2_format.py: change Qcow2BitmapExt initialization method

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich There are two ways to initialize a class derived from Qcow2Struct: 1. Pass a block of binary data to the constructor. 2. Pass the file descriptor to allow reading the file from constructor. Let's change the Qcow2BitmapExt initialization method from 1 to 2 to support a

[PULL 10/14] qcow2_format.py: support dumping metadata in JSON format

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich Implementation of dumping QCOW2 image metadata. The sample output: { "Header_extensions": [ { "name": "Feature table", "magic": 1745090647, "length": 192, "data_str": "" }, { "name":

[PULL 05/14] qcow2_format.py: Dump bitmap directory information

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich Read and dump entries from the bitmap directory of QCOW2 image. Header extension: magic 0x23852875 (Bitmaps) ... Bitmap name bitmap-1 bitmap_table_offset 0xf bitmap_table_size 1 flags 0x2 (['auto'])

[PULL 02/14] qcow2_format.py: make printable data an extension class member

2020-08-21 Thread Eric Blake
From: Andrey Shinkevich Let us differ binary data type from string one for the extension data variable and keep the string as the QcowHeaderExtension class member. Signed-off-by: Andrey Shinkevich Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id:

Re: [PATCH 1/2] fdmon-poll: reset npfd when upgrading to fdmon-epoll

2020-08-21 Thread Philippe Mathieu-Daudé
On 8/21/20 12:12 PM, Stefan Hajnoczi wrote: > npfd keeps track of how many pollfds are currently being monitored. It > must be reset to 0 when fdmon_poll_wait() returns. > > When npfd reaches a treshold we switch to fdmon-epoll because it scales > better. > > This patch resets npfd in the case

Re: [PATCH v5 03/15] block/nvme: Let nvme_create_queue_pair() fail gracefully

2020-08-21 Thread Stefano Garzarella
On Fri, Aug 21, 2020 at 03:36:47PM +0200, Philippe Mathieu-Daudé wrote: > On 8/21/20 11:44 AM, Stefano Garzarella wrote: > > On Thu, Aug 20, 2020 at 06:58:49PM +0200, Philippe Mathieu-Daudé wrote: > >> As nvme_create_queue_pair() is allowed to fail, replace the > >> alloc() calls by try_alloc()

  1   2   >