Re: [PATCH v6 11/11] qapi: Use QAPI_LIST_ADD() where possible

2020-10-26 Thread Thomas Huth
On 27/10/2020 06.05, Eric Blake wrote: > Anywhere we create a list of just one item or by prepending items > (typically because order doesn't matter), we can use the now-public > macro. But places where we must keep the list in order by appending > remain open-coded. > > Signed-off-by: Eric Blake

[PATCH v6 08/11] block: Return depth level during bdrv_is_allocated_above

2020-10-26 Thread Eric Blake
When checking for allocation across a chain, it's already easy to count the depth within the chain at which the allocation is found. Instead of throwing that information away, return it to the caller. Existing callers only cared about allocated/non-allocated, but having a depth available will be us

[PATCH v6 09/11] nbd: Add new qemu:allocation-depth metadata context

2020-10-26 Thread Eric Blake
'qemu-img map' provides a way to determine which extents of an image come from the top layer vs. inherited from a backing chain. This is useful information worth exposing over NBD. There is a proposal to add a QMP command block-dirty-bitmap-populate which can create a dirty bitmap that reflects a

[PATCH v6 07/11] nbd: Allow export of multiple bitmaps for one device

2020-10-26 Thread Eric Blake
With this, 'qemu-nbd -B b0 -B b1 -f qcow2 img.qcow2' can let you sniff out multiple bitmaps from one server. qemu-img as client can still only read one bitmap per client connection, but other NBD clients (hello libnbd) can now read multiple bitmaps in a single pass. Signed-off-by: Eric Blake Rev

[PATCH v6 11/11] qapi: Use QAPI_LIST_ADD() where possible

2020-10-26 Thread Eric Blake
Anywhere we create a list of just one item or by prepending items (typically because order doesn't matter), we can use the now-public macro. But places where we must keep the list in order by appending remain open-coded. Signed-off-by: Eric Blake --- docs/devel/writing-qmp-commands.txt | 13 +++

[PATCH v6 01/11] block: Simplify QAPI_LIST_ADD

2020-10-26 Thread Eric Blake
There is no need to rely on the verbosity of the gcc/clang compiler extension of g_new(typeof(X), 1) when we can instead use the standard g_malloc(sizeof(X)). In general, we like g_new over g_malloc for returning type X rather than void* to let the compiler catch more potential typing mistakes, bu

[PATCH v6 05/11] nbd: Simplify qemu bitmap context name

2020-10-26 Thread Eric Blake
Each dirty bitmap already knows its name; by reducing the scope of the places where we construct "qemu:dirty-bitmap:NAME" strings, tracking the name is more localized, and there are fewer per-export fields to worry about. This in turn will make it easier for an upcoming patch to export more than o

[PATCH v6 10/11] nbd: Add 'qemu-nbd -A' to expose allocation depth

2020-10-26 Thread Eric Blake
Allow the server to expose an additional metacontext to be requested by savvy clients. qemu-nbd adds a new option -A to expose the qemu:allocation-depth metacontext through NBD_CMD_BLOCK_STATUS; this can also be set via QMP when using block-export-add. qemu as client is hacked into viewing the ke

[PATCH v6 02/11] qapi: Make QAPI_LIST_ADD() public

2020-10-26 Thread Eric Blake
We have a useful macro for inserting at the front of any QAPI-generated list; move it from block.c to qapi/util.h so more places can use it, including one earlier place in block.c. There are many more places in the codebase that can benefit from using the macro, but converting them will be left to

[PATCH v6 06/11] nbd: Refactor counting of metadata contexts

2020-10-26 Thread Eric Blake
Rather than open-code the count of negotiated contexts at several sites, embed it directly into the struct. This will make it easier for upcoming commits to support even more simultaneous contexts. Signed-off-by: Eric Blake --- nbd/server.c | 26 +++--- 1 file changed, 15 in

[PATCH v6 03/11] nbd: Utilize QAPI_CLONE for type conversion

2020-10-26 Thread Eric Blake
Rather than open-coding the translation from the deprecated NbdServerAddOptions type to the preferred BlockExportOptionsNbd, it's better to utilize QAPI_CLONE_MEMBERS. This solves a couple of issues: first, if we do any more refactoring of the base type (which an upcoming patch plans to do), we do

[PATCH v6 04/11] nbd: Update qapi to support exporting multiple bitmaps

2020-10-26 Thread Eric Blake
Since 'block-export-add' is new to 5.2, we can still tweak the interface; there, allowing 'bitmaps':['str'] is nicer than 'bitmap':'str'. This wires up the qapi and qemu-nbd changes to permit passing multiple bitmaps as distinct metadata contexts that the NBD client may request, but the actual sup

[PATCH v6 00/11] Exposing backing-chain allocation over NBD

2020-10-26 Thread Eric Blake
v5 was here: https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg07124.html Also available at: https://repo.or.cz/qemu/ericb.git/shortlog/refs/tags/nbd-alloc-depth-v6 Since v5: - rebase to master (mostly affects 8/11) [Vladimir] - drop v5 1/12, and replace with new v6 1/11 [Markus] - rearran

Re: [PULL 0/5] SD/MMC patches for 2020-10-26

2020-10-26 Thread Peter Maydell
> > are available in the Git repository at: > > https://gitlab.com/philmd/qemu.git tags/sd-next-20201026 > > for you to fetch changes up to 89c6700fe7eed9195f10055751edbc6d5e7ab940: > > hw/sd/sdcard: Zero out function selection fields befo

Re: [PATCH v2 12/19] util/vfio-helpers: Let qemu_vfio_do_mapping() propagate Error

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:54 AM, Philippe Mathieu-Daudé wrote: > Pass qemu_vfio_do_mapping() an Error* argument so it can propagate > any error to callers. Replace error_report() which only report > to the monitor by the more generic error_setg_errno(). > > Reviewed-by: Fam Zheng > Reviewed-by

Re: [PATCH v2 18/19] block/nvme: Switch to using the MSIX API

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:55 AM, Philippe Mathieu-Daudé wrote: > In preparation of using multiple IRQs, switch to using the recently > introduced MSIX API. Instead of allocating and assigning IRQ in > a single step, we now have to use two distinct calls. > > Reviewed-by: Stefan Hajnoczi > Sign

Re: [PATCH v2 17/19] util/vfio-helpers: Introduce qemu_vfio_pci_msix_set_irq()

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:55 AM, Philippe Mathieu-Daudé wrote: > Introduce qemu_vfio_pci_msix_set_irq() to set the event > notifier of a specific MSIX IRQ. All other registered IRQs > are left unmodified. > > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Er

Re: [PATCH v2 16/19] util/vfio-helpers: Introduce qemu_vfio_pci_msix_init_irqs()

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:55 AM, Philippe Mathieu-Daudé wrote: > qemu_vfio_pci_init_irq() allows us to initialize any type of IRQ, > but only one. Introduce qemu_vfio_pci_msix_init_irqs() which is > specific to MSIX IRQ type, and allow us to use multiple IRQs > (thus passing multiple eventfd not

Re: [PATCH v2 11/19] util/vfio-helpers: Let qemu_vfio_dma_map() propagate Error

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:54 AM, Philippe Mathieu-Daudé wrote: > Currently qemu_vfio_dma_map() displays errors on stderr. > When using management interface, this information is simply > lost. Pass qemu_vfio_dma_map() an Error* argument so it can Error** or simply error handle > propagate the err

Re: [PATCH 1/4] qdev: Fix two typos

2020-10-26 Thread Laurent Vivier
Le 24/10/2020 à 07:34, Thomas Huth a écrit : > On 19/10/2020 18.36, Maxim Levitsky wrote: >> Signed-off-by: Maxim Levitsky >> --- >> include/hw/qdev-core.h | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h >> index 8689

Re: [PATCH v2 07/19] util/vfio-helpers: Trace PCI BAR region info

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:54 AM, Philippe Mathieu-Daudé wrote: > For debug purpose, trace BAR regions info. > > Reviewed-by: Fam Zheng > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Philippe Mathieu-Daudé > --- > util/vfio-helpers.c | 8 > util/trace-events | 1 + > 2 files chan

Re: [PATCH v2 06/19] util/vfio-helpers: Trace PCI I/O config accesses

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:54 AM, Philippe Mathieu-Daudé wrote: > We sometime get kernel panic with some devices on Aarch64 > hosts. Alex Williamson suggests it might be broken PCIe > root complex. Add trace event to record the latest I/O > access before crashing. In case, assert our accesses are

Re: [PATCH v2 04/19] block/nvme: Trace controller capabilities

2020-10-26 Thread Auger Eric
Hi, On 10/26/20 11:54 AM, Philippe Mathieu-Daudé wrote: > Controllers have different capabilities and report them in the > CAP register. We are particularly interested by the page size > limits. > > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 10 ++ > block/trace-

Re: [PATCH v2 03/19] block/nvme: Introduce device/iommu 'page_size_min' variables

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:54 AM, Philippe Mathieu-Daudé wrote: > Introduce device/iommu 'page_size_min' variables to make > the code clearer. I am unclear how much the device and the iommu page size must equal. For instance, in [RFC 0/5] NVMe passthrough: Support 64kB page host, I have a 64kB h

Re: [PATCH v2 01/19] block/nvme: Correct minimum device page size

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:54 AM, Philippe Mathieu-Daudé wrote: > While trying to simplify the code using a macro, we forgot > the 12-bit shift... Correct that. > > Fixes: fad1eb68862 ("block/nvme: Use register definitions from > 'block/nvme.h'") > Reported-by: Eric Auger > Reviewed-by: Stefan

Re: [PATCH v2 02/19] block/nvme: Set request_alignment at initialization

2020-10-26 Thread Auger Eric
Hi, On 10/26/20 11:54 AM, Philippe Mathieu-Daudé wrote: > When introducing this driver in commit bdd6a90a9e5 > ("block: Add VFIO based NVMe driver") we correctly > set the request_alignment in nvme_refresh_limits() > but forgot to set it at initialization. Do it now. > > Reported-by: Stefan Hajno

[PATCH v3 24/25] simplebench: bench_block_job: add cmd_options argument

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Add argument to allow additional block-job options. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- scripts/simplebench/bench-example.py | 2 +- scripts/simplebench/bench_block_job.py | 11 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/scri

[PATCH v3 25/25] simplebench: add bench-backup.py

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Add script to benchmark new backup architecture. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/simplebench/bench-backup.py | 165 1 file changed, 165 insertions(+) create mode 100755 scripts/simplebench/bench-backup.py diff --git a/scripts/simplebench/ben

[PATCH v3 22/25] block/block-copy: drop unused argument of block_copy()

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/block/block-copy.h | 2 +- block/backup-top.c | 2 +- block/block-copy.c | 10 ++ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/block/block-copy.h b/include/block/bl

[PATCH v3 17/25] block/block-copy: make progress_bytes_callback optional

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
We are going to stop use of this callback in the following commit. Still the callback handling code will be dropped in a separate commit. So, for now let's make it optional. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/block-copy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-

[PATCH v3 14/25] iotests: 185: prepare for backup over block-copy

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
The further change of moving backup to be a one block-copy call will make copying chunk-size and cluster-size two separate things. So, even with 64k cluster sized qcow2 image, default chunk would be 1M. 185 test however assumes, that with speed limited to 64K, one iteration would result in offset=6

[PATCH v3 16/25] iotests: 257: prepare for backup over block-copy

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Iotest 257 dumps a lot of in-progress information of backup job, such as offset and bitmap dirtiness. Further commit will move backup to be one block-copy call, which will introduce async parallel requests instead of plain cluster-by-cluster copying. To keep things deterministic, allow only one wor

[PATCH v3 07/25] block/block-copy: add ratelimit to block-copy

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
We are going to directly use one async block-copy operation for backup job, so we need rate limiter. We want to maintain current backup behavior: only background copying is limited and copy-before-write operations only participate in limit calculation. Therefore we need one rate limiter for block-

[PATCH v3 23/25] simplebench/bench_block_job: use correct shebang line with python3

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/simplebench/bench_block_job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simplebench/bench_block_job.py b/scripts/simplebench/bench_block_job.py index 9808d696cf..a0dda1dc4e 100755 --- a/scripts/simplebench

[PATCH v3 11/25] qapi: backup: add max-chunk and max-workers to x-perf struct

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Add new parameters to configure future backup features. The patch doesn't introduce aio backup requests (so we actually have only one worker) neither requests larger than one cluster. Still, formally we satisfy these maximums anyway, so add the parameters now, to facilitate further patch which will

[PATCH v3 21/25] block/block-copy: drop unused block_copy_set_progress_callback()

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Drop unused code. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 6 -- block/block-copy.c | 15 --- 2 files changed, 21 deletions(-) diff --git a/include/block/block-copy.h b/include/block/block-copy.h index 8f5013d0aa..7b77abf70b 100644 --

[PATCH v3 12/25] iotests: 56: prepare for backup over block-copy

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
After introducing parallel async copy requests instead of plain cluster-by-cluster copying loop, we'll have to wait for paused status, as we need to wait for several parallel request. So, let's gently wait instead of just asserting that job already paused. Signed-off-by: Vladimir Sementsov-Ogievsk

[PATCH v3 15/25] iotests: 219: prepare for backup over block-copy

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
The further change of moving backup to be a one block-copy call will make copying chunk-size and cluster-size two separate things. So, even with 64k cluster sized qcow2 image, default chunk would be 1M. Test 219 depends on specified chunk-size. Update it for explicit chunk-size for backup as for mi

[PATCH v3 10/25] job: call job_enter from job_user_pause

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
If main job coroutine called job_yield (while some background process is in progress), we should give it a chance to call job_pause_point(). It will be used in backup, when moved on async block-copy. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- job.c | 1 + 1 file chan

[PATCH v3 08/25] block/block-copy: add block_copy_cancel

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Add function to cancel running async block-copy call. It will be used in backup. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 13 + block/block-copy.c | 24 +++- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git

[PATCH v3 02/25] qapi: backup: add perf.use-copy-range parameter

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Experiments show, that copy_range is not always making things faster. So, to make experimentation simpler, let's add a parameter. Some more perf parameters will be added soon, so here is a new struct. For now, add new backup qmp parameter with x- prefix for the following reasons: - We are going

[PATCH v3 01/25] iotests: 129 don't check backup "busy"

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Busy is racy, job has it's "pause-points" when it's not busy. Drop this check. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/129 | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/qemu-iotests/129 b/tests/qemu-iotests/129 index 0e13244d85..3c22f

[PATCH v3 09/25] blockjob: add set_speed to BlockJobDriver

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
We are going to use async block-copy call in backup, so we'll need to passthrough setting backup speed to block-copy call. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/block/blockjob_int.h | 2 ++ blockjob.c | 6 ++ 2 files changed, 8 inse

[PATCH v3 03/25] block/block-copy: More explicit call_state

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Refactor common path to use BlockCopyCallState pointer as parameter, to prepare it for use in asynchronous block-copy (at least, we'll need to run block-copy in a coroutine, passing the whole parameters as one pointer). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- bloc

[PATCH v3 04/25] block/block-copy: implement block_copy_async

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
We'll need async block-copy invocation to use in backup directly. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 26 block/block-copy.c | 81 -- 2 files changed, 103 insertions(+), 4 deletions(-) diff --git a

[PATCH v3 06/25] block/block-copy: add list of all call-states

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
It simplifies debugging. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/block-copy.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/block/block-copy.c b/block/block-copy.c index 35213bd832..6bf1735b93 100644 --- a/block/block-copy.c +++ b/block/block-copy.

[PATCH v3 20/25] qapi: backup: disable copy_range by default

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Further commit will add a benchmark (scripts/simplebench/bench-backup.py), which will show that backup works better with async parallel requests (previous commit) and disabled copy_range. So, let's disable copy_range by default. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.jso

[PATCH v3 19/25] backup: move to block-copy

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
This brings async request handling and block-status driven chunk sizes to backup out of the box, which improves backup performance. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/backup.c | 187 - 1 file changed, 121 insertions(+), 66 deleti

[PATCH v3 13/25] iotests: 129: prepare for backup over block-copy

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
After introducing parallel async copy requests instead of plain cluster-by-cluster copying loop, backup job may finish earlier than final assertion in do_test_stop. Let's require slow backup explicitly by specifying speed parameter. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iote

[PATCH v3 18/25] block/backup: drop extra gotos from backup_run()

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/backup.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/block/backup.c b/block/backup.c index 8c67d77504..449b763ce4 100644 --- a/block/backup.c +++ b/block/backup.c @@ -236,7 +236,7 @@ static void backup_init

[PATCH v3 00/25] backup performance: block_status + async

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
Hi all! The series turn backup into series of block_copy_async calls, covering the whole disk, so we get block-status based paralallel async requests out of the box, which gives performance gain: All results are in seconds - --- - -- -

[PATCH v3 05/25] block/block-copy: add max_chunk and max_workers parameters

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
They will be used for backup. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 6 ++ block/block-copy.c | 11 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/block/block-copy.h b/include/block/block-copy.h index 3566827

Re: [PATCH v2 3/3] hw/ssi: Rename SSI 'slave' as 'peripheral'

2020-10-26 Thread Paolo Bonzini
On 12/10/20 14:49, Philippe Mathieu-Daudé wrote: > In order to use inclusive terminology, rename SSI 'slave' as > 'peripheral', following the specification resolution: > https://www.oshwa.org/a-resolution-to-redefine-spi-signal-names/ > > Patch created mechanically using: > > $ sed -i s/SSISlav

Re: [PATCH v2 0/3] hw/ssi: Rename SSI 'slave' as 'peripheral'

2020-10-26 Thread Paolo Bonzini
On 26/10/20 18:05, Philippe Mathieu-Daudé wrote: > ping^2? > > On 10/19/20 6:04 PM, Philippe Mathieu-Daudé wrote: >> Ping for review? >> >> On 10/12/20 2:49 PM, Philippe Mathieu-Daudé wrote: >>> Since v1: >>> - Fixed patch #1 subject (Kevin) >>> >>> In order to use inclusive terminology, rename SS

Re: [PATCH v2 0/3] hw/ssi: Rename SSI 'slave' as 'peripheral'

2020-10-26 Thread Philippe Mathieu-Daudé
ping^2? On 10/19/20 6:04 PM, Philippe Mathieu-Daudé wrote: Ping for review? On 10/12/20 2:49 PM, Philippe Mathieu-Daudé wrote: Since v1: - Fixed patch #1 subject (Kevin) In order to use inclusive terminology, rename SSI 'slave' as 'peripheral', following the resolution Paolo pointed in [*]: h

[PATCH v5 1/2] qcow2: Report BDRV_BLOCK_ZERO more accurately in bdrv_co_block_status()

2020-10-26 Thread Alberto Garcia
If a BlockDriverState supports backing files but has none then any unallocated area reads back as zeroes. bdrv_co_block_status() is only reporting this is if want_zero is true, but this is an inexpensive test and there is no reason not to do it in all cases. Suggested-by: Vladimir Sementsov-Ogiev

[PATCH v5 0/2] Skip copy-on-write when allocating a zero cluster

2020-10-26 Thread Alberto Garcia
I had to rebase the series due to conflicting changes on master. There are no other differences. Berto v5: - Fix rebase conflicts after 3555a43261 v4: https://lists.gnu.org/archive/html/qemu-block/2020-09/msg01515.html - Fix rebase conflicts after cb8503159a v3: https://lists.gnu.org/archive/ht

[PATCH v5 2/2] qcow2: Skip copy-on-write when allocating a zero cluster

2020-10-26 Thread Alberto Garcia
Since commit c8bb23cbdbe32f5c326365e0a82e1b0e68cdcd8a when a write request results in a new allocation QEMU first tries to see if the rest of the cluster outside the written area contains only zeroes. In that case, instead of doing a normal copy-on-write operation and writing explicit zero buffers

Re: [PATCH v3 0/9] block-backend: Introduce I/O hang

2020-10-26 Thread Stefan Hajnoczi
On Thu, Oct 22, 2020 at 09:02:54PM +0800, Jiahui Cen wrote: > A VM in the cloud environment may use a virutal disk as the backend storage, > and there are usually filesystems on the virtual block device. When backend > storage is temporarily down, any I/O issued to the virtual block device will > c

Re: [PATCH v2 15/19] util/vfio-helpers: Report error when IOMMU page size is not supported

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:55 AM, Philippe Mathieu-Daudé wrote: > This driver uses the host page size to align its memory regions, > but this size is not always compatible with the IOMMU. Add a > check if the size matches, and bails out providing a hint what > is the minimum page size the driver

Re: [PATCH v6 3/3] hw/block/nvme: add the dataset management command

2020-10-26 Thread Keith Busch
On Mon, Oct 26, 2020 at 07:01:01AM +0100, Klaus Jensen wrote: > From: Klaus Jensen > > Add support for the Dataset Management command and the Deallocate > attribute. Deallocation results in discards being sent to the underlying > block device. Whether of not the blocks are actually deallocated is

Re: [PATCH v6 2/3] nvme: add namespace I/O optimization fields to shared header

2020-10-26 Thread Stefan Hajnoczi
On Mon, Oct 26, 2020 at 07:01:00AM +0100, Klaus Jensen wrote: > From: Klaus Jensen > > This adds the NPWG, NPWA, NPDG, NPDA and NOWS family of fields to the > shared nvme.h header for use by later patches. > > Signed-off-by: Klaus Jensen > Cc: Stefan Hajnoczi > Cc: Fam Zheng > --- > include/

Re: [PATCH v2 17/20] backup: move to block-copy

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
23.07.2020 12:47, Max Reitz wrote: +static void coroutine_fn backup_set_speed(BlockJob *job, int64_t speed) +{ +BackupBlockJob *s = container_of(job, BackupBlockJob, common); + +if (s->bcs) { +/* In block_job_create we yet don't have bcs */ Shouldn’t hurt to make it conditional,

Re: [PATCH v5 00/12] Exposing backing-chain allocation over NBD

2020-10-26 Thread Markus Armbruster
Eric Blake writes: > On 10/23/20 1:36 PM, Eric Blake wrote: >> v4 was here: >> https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg02708.html >> >> Since then: >> - rebase to master >> - patches 1, 2, and 12 are new based on Vladimir's observation of >> QAPI_LIST_ADD >> - patches 10-11 are

Re: [PATCH v5 03/12] nbd: Utilize QAPI_CLONE for type conversion

2020-10-26 Thread Markus Armbruster
Eric Blake writes: > Rather than open-coding the translation from the deprecated > NbdServerAddOptions type to the preferred BlockExportOptionsNbd, it's > better to utilize QAPI_CLONE_MEMBERS. This solves a couple of issues: > first, if we do any more refactoring of the base type (which an > upc

Re: [PATCH v5 02/12] qapi: Make QAPI_LIST_ADD() public

2020-10-26 Thread Eric Blake
On 10/26/20 9:37 AM, Eric Blake wrote: >> PATCH 12 has more. I wonder whether PATCH 12 should be squashed into >> this one. You decide. > > Patch 12 has a LOT more. And we're really close to soft freeze. I kept > them separate to minimize the risk of landing my QAPI changes (4/12) Correction

Re: [PATCH v5 02/12] qapi: Make QAPI_LIST_ADD() public

2020-10-26 Thread Eric Blake
On 10/26/20 9:25 AM, Markus Armbruster wrote: > Eric Blake writes: > >> We have a useful macro for inserting at the front of any >> QAPI-generated list; move it from block.c to qapi/util.h so more >> places can use it, including one earlier place in block.c. >> >> Suggested-by: Vladimir Sementsov

Re: [PATCH v5 02/12] qapi: Make QAPI_LIST_ADD() public

2020-10-26 Thread Markus Armbruster
Eric Blake writes: > We have a useful macro for inserting at the front of any > QAPI-generated list; move it from block.c to qapi/util.h so more > places can use it, including one earlier place in block.c. > > Suggested-by: Vladimir Sementsov-Ogievskiy > Signed-off-by: Eric Blake > --- > inclu

Re: [PATCH v5 01/12] qapi: Move GenericList to qapi/util.h

2020-10-26 Thread Eric Blake
On 10/26/20 9:18 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Placing GenericList in util.h will make it easier for the next patch >> to promote QAPI_LIST_ADD() into a public macro without requiring more >> files to include the unrelated visitor.h. > > Is this true? > > You don't actu

Re: [PATCH v5 01/12] qapi: Move GenericList to qapi/util.h

2020-10-26 Thread Markus Armbruster
Eric Blake writes: > Placing GenericList in util.h will make it easier for the next patch > to promote QAPI_LIST_ADD() into a public macro without requiring more > files to include the unrelated visitor.h. Is this true? You don't actually need GenericList to make use of QAPI_LIST_ADD(), do you?

Re: [PATCH 6/6] qemu-storage-daemon: Use qmp_chardev_add() for --chardev

2020-10-26 Thread Markus Armbruster
Kevin Wolf writes: > While this makes the code quite a bit longer and arguably isn't very > elegant, it removes the dependency on QemuOpts from the --chardev option > of the storage daemon. > > Going through qmp_chardev_add() already now ensures that semantics and > accessible features won't chan

Re: [PATCH v5 06/12] nbd: Update qapi to support exporting multiple bitmaps

2020-10-26 Thread Eric Blake
On 10/26/20 5:50 AM, Peter Krempa wrote: > On Fri, Oct 23, 2020 at 13:36:46 -0500, Eric Blake wrote: >> Since 'nbd-server-add' is deprecated, and 'block-export-add' is new to >> 5.2, we can still tweak the interface. Allowing 'bitmaps':['str'] is >> nicer than 'bitmap':'str'. This wires up the qa

Re: [PATCH v5 11/12] nbd: Expose actual depth in qemu:allocation-depth

2020-10-26 Thread Eric Blake
On 10/24/20 4:59 AM, Vladimir Sementsov-Ogievskiy wrote: > 23.10.2020 21:36, Eric Blake wrote: >> Preserve the tri-state encoding in the low bits, as that still remains >> a valuable way to utilize qemu-img map with x-dirty-bitmap for >> accessing quick information without needing a third-party NBD

Re: [PATCH v5 10/12] block: Return depth level during bdrv_is_allocated_above

2020-10-26 Thread Vladimir Sementsov-Ogievskiy
24.10.2020 12:49, Vladimir Sementsov-Ogievskiy wrote: 23.10.2020 21:36, Eric Blake wrote: When checking for allocation across a chain, it's already easy to count the depth within the chain at which the allocation is found. Instead of throwing that information away, return it to the caller. Exist

[PULL 1/2] migration/block-dirty-bitmap: fix larger granularity bitmaps

2020-10-26 Thread Eric Blake
From: Stefan Reiter sectors_per_chunk is a 64 bit integer, but the calculation is done in 32 bits, leading to an overflow for coarse bitmap granularities. If that results in the value 0, it leads to a hang where no progress is made but send_bitmap_bits is constantly called with nr_sectors being

[PULL 2/2] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-26 Thread Eric Blake
From: Chen Qun A default value is provided for the variable 'bitmap_name' to avoid a compiler warning. The compiler showed the warning: migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may be used uninitialized in this function [-Wmaybe-uninitialized] g_strlcpy(s->bitmap_nam

Re: [PULL v3 00/28] Block patches

2020-10-26 Thread Peter Maydell
On Fri, 23 Oct 2020 at 16:21, Stefan Hajnoczi wrote: > > The following changes since commit 4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430: > > Merge remote-tracking branch > 'remotes/kraxel/tags/modules-20201022-pull-request' into staging (2020-10-22 > 12:33:21 +0100) > > are available in the Git r

Re: Allocation change in qemu-img convert (since 5.1?)

2020-10-26 Thread Nir Soffer
On Sun, Oct 25, 2020 at 5:55 PM Nir Soffer wrote: > > We have tests for vdsm qemuimg wrapper module converting > images and verifying the operation using "qemu-img compare". > > I found that tests using "qemu-img compare -s" started to fail > recently on RHEL 8.3.0 nightly > (qemu-img-5.1.0-10.mod

[PULL 2/5] hw/sd/sdcard: Simplify cmd_valid_while_locked()

2020-10-26 Thread Philippe Mathieu-Daudé
cmd_valid_while_locked() only needs to read SDRequest->cmd, pass it directly and make it const. Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20200630133912.9428-13-f4...@amsat.org> --- hw/sd/sd.c | 11 +-- 1 file changed, 5

[PULL 4/5] hw/sd/sdcard: Make iolen unsigned

2020-10-26 Thread Philippe Mathieu-Daudé
I/O request length can not be negative. Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20200630133912.9428-15-f4...@amsat.org> --- hw/sd/sd.c | 2 +- hw/sd/trace-events | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)

Re: [PATCH v2 3/6] qapi: Remove wrapper struct for simple unions

2020-10-26 Thread Kevin Wolf
Am 25.10.2020 um 10:16 hat Markus Armbruster geschrieben: > I apologize for writing so much. It's the only way I know to figure out > how things work. > > This may feel like I'm trying to shoot down your patch. I'm not! I'm > merely trying to understand and maybe improve it. I'd love to get ri

[PULL 5/5] hw/sd/sdcard: Zero out function selection fields before being populated

2020-10-26 Thread Philippe Mathieu-Daudé
From: Bin Meng The function selection fields (399:376) should be zeroed out to prevent leftover from being or'ed into the switch function status data structure. This fixes the boot failure as seen in the acceptance testing on the orangepi target. Fixes: b638627c723a ("hw/sd: Fix incorrect popul

[PULL 0/5] SD/MMC patches for 2020-10-26

2020-10-26 Thread Philippe Mathieu-Daudé
gs/sd-next-20201026 for you to fetch changes up to 89c6700fe7eed9195f10055751edbc6d5e7ab940: hw/sd/sdcard: Zero out function selection fields before being populated (20= 20-10-26 09:23:47 +0100) SD/MMC patches - Fix a b

[PULL 3/5] hw/sd/sdcard: Constify sd_crc*()'s message argument

2020-10-26 Thread Philippe Mathieu-Daudé
CRC functions don't modify the buffer argument, make it const. Reviewed-by: Alistair Francis Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200630133912.9428-14-f4...@amsat.org> --- hw/sd/sd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH v2 19/19] util/vfio-helpers: Remove now unused qemu_vfio_pci_init_irq()

2020-10-26 Thread Philippe Mathieu-Daudé
Our only user, the NVMe block driver, switched to the MSIX API. As this function is now unused, remove it. Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/vfio-helpers.h | 2 -- util/vfio-helpers.c | 43 - 2 files

[PULL 1/5] hw/sd/sdcard: Update the SDState documentation

2020-10-26 Thread Philippe Mathieu-Daudé
Add more descriptive comments to keep a clear separation between static property vs runtime changeable. Suggested-by: Peter Maydell Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20200630133912.9428-12-f4...@amsat.org> --- hw/sd/sd.

[PATCH v2 14/19] util/vfio-helpers: Pass minimum page size to qemu_vfio_open_pci()

2020-10-26 Thread Philippe Mathieu-Daudé
The block driver asks for a minimum page size, but it might not match the minimum IOMMU requirement. In the next commit qemu_vfio_init_pci() will be able to report the minimum IOMMU page size back to the block driver. In preparation, pass the minimum page size as argument to qemu_vfio_open_pci().

[PATCH v2 13/19] util/vfio-helpers: Let qemu_vfio_verify_mappings() use error_report()

2020-10-26 Thread Philippe Mathieu-Daudé
Instead of displaying the error on stderr, use error_report() which also report to the monitor. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/vfio-he

[PATCH v2 18/19] block/nvme: Switch to using the MSIX API

2020-10-26 Thread Philippe Mathieu-Daudé
In preparation of using multiple IRQs, switch to using the recently introduced MSIX API. Instead of allocating and assigning IRQ in a single step, we now have to use two distinct calls. Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 14 -- 1 fi

[PATCH v2 16/19] util/vfio-helpers: Introduce qemu_vfio_pci_msix_init_irqs()

2020-10-26 Thread Philippe Mathieu-Daudé
qemu_vfio_pci_init_irq() allows us to initialize any type of IRQ, but only one. Introduce qemu_vfio_pci_msix_init_irqs() which is specific to MSIX IRQ type, and allow us to use multiple IRQs (thus passing multiple eventfd notifiers). All eventfd notifiers are initialized with the special '-1' value

[PATCH v2 17/19] util/vfio-helpers: Introduce qemu_vfio_pci_msix_set_irq()

2020-10-26 Thread Philippe Mathieu-Daudé
Introduce qemu_vfio_pci_msix_set_irq() to set the event notifier of a specific MSIX IRQ. All other registered IRQs are left unmodified. Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/vfio-helpers.h | 2 ++ util/vfio-helpers.c | 35 ++

[PATCH v2 10/19] util/vfio-helpers: Convert vfio_dump_mapping to trace events

2020-10-26 Thread Philippe Mathieu-Daudé
The QEMU_VFIO_DEBUG definition is only modifiable at build-time. Trace events can be enabled at run-time. As we prefer the latter, convert qemu_vfio_dump_mappings() to use trace events instead of fprintf(). Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé

[PATCH v2 11/19] util/vfio-helpers: Let qemu_vfio_dma_map() propagate Error

2020-10-26 Thread Philippe Mathieu-Daudé
Currently qemu_vfio_dma_map() displays errors on stderr. When using management interface, this information is simply lost. Pass qemu_vfio_dma_map() an Error* argument so it can propagate the error to callers. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Dau

[PATCH v2 15/19] util/vfio-helpers: Report error when IOMMU page size is not supported

2020-10-26 Thread Philippe Mathieu-Daudé
This driver uses the host page size to align its memory regions, but this size is not always compatible with the IOMMU. Add a check if the size matches, and bails out providing a hint what is the minimum page size the driver should use. Suggested-by: Alex Williamson Reviewed-by: Stefan Hajnoczi

[PATCH v2 07/19] util/vfio-helpers: Trace PCI BAR region info

2020-10-26 Thread Philippe Mathieu-Daudé
For debug purpose, trace BAR regions info. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 8 util/trace-events | 1 + 2 files changed, 9 insertions(+) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index 1

[PATCH v2 12/19] util/vfio-helpers: Let qemu_vfio_do_mapping() propagate Error

2020-10-26 Thread Philippe Mathieu-Daudé
Pass qemu_vfio_do_mapping() an Error* argument so it can propagate any error to callers. Replace error_report() which only report to the monitor by the more generic error_setg_errno(). Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpe

[PATCH v2 09/19] util/vfio-helpers: Improve DMA trace events

2020-10-26 Thread Philippe Mathieu-Daudé
For debugging purpose, trace where DMA regions are mapped. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 3 ++- util/trace-events | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/util/vfio-helpers.

[PATCH v2 08/19] util/vfio-helpers: Trace where BARs are mapped

2020-10-26 Thread Philippe Mathieu-Daudé
For debugging purpose, trace where a BAR is mapped. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 2 ++ util/trace-events | 1 + 2 files changed, 3 insertions(+) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c inde

[PATCH v2 04/19] block/nvme: Trace controller capabilities

2020-10-26 Thread Philippe Mathieu-Daudé
Controllers have different capabilities and report them in the CAP register. We are particularly interested by the page size limits. Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 10 ++ block/trace-events | 1 + 2 files changed, 11 insertions(+) diff --git a/block/nvme

[PATCH v2 06/19] util/vfio-helpers: Trace PCI I/O config accesses

2020-10-26 Thread Philippe Mathieu-Daudé
We sometime get kernel panic with some devices on Aarch64 hosts. Alex Williamson suggests it might be broken PCIe root complex. Add trace event to record the latest I/O access before crashing. In case, assert our accesses are aligned. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-of

  1   2   >