Re: [PATCH v3 00/17] iotests: support zstd

2021-10-07 Thread Hanna Reitz
On 07.10.21 18:29, Vladimir Sementsov-Ogievskiy wrote: 9/14/21 20:08, Hanna Reitz wrote: On 14.09.21 12:25, Vladimir Sementsov-Ogievskiy wrote: These series makes tests pass with     IMGOPTS='compression_type=zstd' Also, python iotests start to support IMGOPTS (they didn't before). v3: 02-04

[PATCH v2 0/2] pylint: fix new errors and warnings in qemu-iotests

2021-10-07 Thread Emanuele Giuseppe Esposito
There are some warnings and errors that we either miss or are new in pylint. Anyways, test 297 of qemu-iotests fails because of that, so we need to fix it. All these fixes involve just indentation or additional spaces added. Signed-off-by: Emanuele Giuseppe Esposito --- v2: * temporarly enable a

Re: [PATCH 00/15] hw/nvme: SR-IOV with Virtualization Enhancements

2021-10-07 Thread Klaus Jensen
On Oct 7 18:23, Lukasz Maniak wrote: > Hi, > > This series of patches is an attempt to add support for the following > sections of NVMe specification revision 1.4: > > 8.5 Virtualization Enhancements (Optional) > 8.5.1 VQ Resource Definition > 8.5.2 VI Resource Definition > 8.5.3 Sec

[PATCH v2 2/2] qemu-iotests: fix image-fleecing pylint errors

2021-10-07 Thread Emanuele Giuseppe Esposito
The problem here is that some variables are formatted with unnecessary spaces to make it prettier and easier to read. However, pylint complains about those additional spaces. Temporarly remove the check, but just on those variables. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotes

[PATCH v2 1/2] pylint: fix errors and warnings generated by tests/qemu-iotests/297

2021-10-07 Thread Emanuele Giuseppe Esposito
Test 297 in tests/qemu-iotests currently fails: pylint has learned new things to check, or we simply missed them. All fixes in this patch are related to additional spaces used or wrong indentation. No functional change intended. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/1

[PATCH v2 5/5] tests/qtest: add qtests for npcm7xx sdhci

2021-10-07 Thread Hao Wu
From: Shengtan Mao Signed-off-by: Shengtan Mao Reviewed-by: Hao Wu Reviewed-by: Chris Rauer Reviewed-by: Tyrone Ting Signed-off-by: Hao Wu --- tests/qtest/meson.build | 1 + tests/qtest/npcm7xx_sdhci-test.c | 209 +++ 2 files changed, 210 insertions(+)

[PATCH v2 3/5] hw/arm: Attach MMC to quanta-gbs-bmc

2021-10-07 Thread Hao Wu
From: Shengtan Mao Signed-off-by: Shengtan Mao Reviewed-by: Hao Wu Reviewed-by: Tyrone Ting Signed-off-by: Hao Wu Reviewed-by: Peter Maydell --- hw/arm/npcm7xx_boards.c | 20 1 file changed, 20 insertions(+) diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.

[PATCH v2 4/5] tests/qtest/libqos: add SDHCI commands

2021-10-07 Thread Hao Wu
From: Shengtan Mao Signed-off-by: Shengtan Mao Reviewed-by: Hao Wu Reviewed-by: Chris Rauer Reviewed-by: Tyrone Ting Signed-off-by: Hao Wu --- tests/qtest/libqos/meson.build | 1 + tests/qtest/libqos/sdhci-cmd.c | 116 + tests/qtest/libqos/sdhci-cmd.h | 70

[PATCH v2 2/5] hw/arm: Add Nuvoton SD module to board

2021-10-07 Thread Hao Wu
From: Shengtan Mao Signed-off-by: Shengtan Mao Reviewed-by: Hao Wu Reviewed-by: Chris Rauer Reviewed-by: Tyrone Ting Signed-off-by: Hao Wu --- hw/arm/npcm7xx.c | 12 +++- include/hw/arm/npcm7xx.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/arm/

[PATCH v2 1/5] hw/sd: add nuvoton MMC

2021-10-07 Thread Hao Wu
From: Shengtan Mao Signed-off-by: Shengtan Mao Reviewed-by: Hao Wu Reviewed-by: Chris Rauer Reviewed-by: Tyrone Ting Signed-off-by: Hao Wu --- hw/sd/meson.build | 1 + hw/sd/npcm7xx_sdhci.c | 182 ++ include/hw/sd/npcm7xx_sdhci.h | 65

[PATCH v2 0/5] hw/arm: Add MMC device for NPCM7XX boards

2021-10-07 Thread Hao Wu
This patch set implements the Nuvoton MMC device for NPCM7XX boards. The MMC device is compatible with the SDHCI interface in QEMU. It allows the user to attach an SD card image to it. Changes since v1: 1. Rearrange the "add SDHCI commands" to just before when it's actually used. 2. Add standr

Re: [PATCH 01/15] pcie: Set default and supported MaxReadReq to 512

2021-10-07 Thread Michael S. Tsirkin
On Thu, Oct 07, 2021 at 06:23:52PM +0200, Lukasz Maniak wrote: > From: Knut Omang > > Make the default PCI Express Capability for PCIe devices set > MaxReadReq to 512. code says 256 > Tyipcal modern devices people would want to typo > emulate or simulate would want this. The previous value w

Re: [PATCH v2 04/17] python/aqmp: add send_fd_scm

2021-10-07 Thread Eric Blake
On Thu, Oct 07, 2021 at 12:27:24PM -0400, John Snow wrote: > On Thu, Oct 7, 2021 at 10:52 AM Eric Blake wrote: > > > On Wed, Sep 22, 2021 at 08:49:25PM -0400, John Snow wrote: > > > The single space is indeed required to successfully transmit the file > > > descriptor to QEMU. > > > > Sending fds

Re: [PATCH 14/12] block-backend: update blk_co_pwrite() and blk_co_pread() wrappers

2021-10-07 Thread Eric Blake
On Thu, Oct 07, 2021 at 07:52:43PM +0200, Vladimir Sementsov-Ogievskiy wrote: > Make bytes argument int64_t to be consistent with modern block-layer. > Callers should be OK with it as type becomes wider. > > What is inside functions? > > - Conversion from int64_t to size_t. Still, we > can't have

Re: [PATCH 13/12] block-backend: fix blk_co_flush prototype to mention coroutine_fn

2021-10-07 Thread Eric Blake
On Thu, Oct 07, 2021 at 07:52:42PM +0200, Vladimir Sementsov-Ogievskiy wrote: > We do have this marker for blk_co_flush function declaration in > block/block-backend.c. Add it in header too. Maybe: We alreaddy have this marker for the blk_co_flush function declaration in block/block-backend.c. A

Re: [PULL v2 00/15] jobs: mirror: Handle errors after READY cancel

2021-10-07 Thread Richard Henderson
On 10/7/21 8:39 AM, Vladimir Sementsov-Ogievskiy wrote: The following changes since commit 9618c5badaa8eed25259cf095ff880efb939fbe7: Merge remote-tracking branch 'remotes/vivier/tags/trivial-branch-for-6.2-pull-request' into staging (2021-10-04 16:27:35 -0700) are available in the Git repo

[PATCH 14/12] block-backend: update blk_co_pwrite() and blk_co_pread() wrappers

2021-10-07 Thread Vladimir Sementsov-Ogievskiy
Make bytes argument int64_t to be consistent with modern block-layer. Callers should be OK with it as type becomes wider. What is inside functions? - Conversion from int64_t to size_t. Still, we can't have a buffer larger than SIZE_MAX, therefore bytes should not be larger than SIZE_MAX as well.

[PATCH 13/12] block-backend: fix blk_co_flush prototype to mention coroutine_fn

2021-10-07 Thread Vladimir Sementsov-Ogievskiy
We do have this marker for blk_co_flush function declaration in block/block-backend.c. Add it in header too. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/sysemu/block-backend.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sysemu/block-backend.h b/include

[PATCH 10/15] hw/nvme: Make max_ioqpairs and msix_qsize configurable in runtime

2021-10-07 Thread Lukasz Maniak
From: Łukasz Gieryk The Nvme device defines two properties: max_ioqpairs, msix_qsize. Having them as constants is problematic for SR-IOV support. The SR-IOV feature introduces virtual resources (queues, interrupts) that can be assigned to PF and its dependent VFs. Each device, following a reset,

[PATCH 09/15] hw/nvme: Implement the Function Level Reset

2021-10-07 Thread Lukasz Maniak
From: Łukasz Gieryk This patch implements the FLR, a feature currently not implemented for the Nvme device, while listed as a mandatory ("shall") in the 1.4 spec. The implementation reuses FLR-related building blocks defined for the pci-bridge module, and follows the same logic: - FLR capabi

[PATCH 14/15] hw/nvme: Add support for the Virtualization Management command

2021-10-07 Thread Lukasz Maniak
From: Łukasz Gieryk With the new command one can: - assign flexible resources (queues, interrupts) to primary and secondary controllers, - toggle the online/offline state of given controller. Signed-off-by: Łukasz Gieryk --- hw/nvme/ctrl.c | 207 +

[PATCH 15/15] docs: Add documentation for SR-IOV and Virtualization Enhancements

2021-10-07 Thread Lukasz Maniak
Signed-off-by: Lukasz Maniak --- docs/system/devices/nvme.rst | 27 +++ 1 file changed, 27 insertions(+) diff --git a/docs/system/devices/nvme.rst b/docs/system/devices/nvme.rst index bff72d1c24..904fd7290c 100644 --- a/docs/system/devices/nvme.rst +++ b/docs/system/devic

[PATCH 11/15] hw/nvme: Calculate BAR atributes in a function

2021-10-07 Thread Lukasz Maniak
From: Łukasz Gieryk An Nvme device with SR-IOV capability calculates the BAR size differently for PF and VF, so it makes sense to extract the common code to a separate function. Also: it seems the n->reg_size parameter unnecessarily splits the BAR size calculation in two phases; removed to simpl

[PATCH 07/15] hw/nvme: Add support for Secondary Controller List

2021-10-07 Thread Lukasz Maniak
Introduce handling for Secondary Controller List (Identify command with CNS value of 15h). Secondary controller ids are unique in the subsystem, hence they are reserved by it upon initialization of the primary controller to the number of sriov_max_vfs. ID reservation requires the addition of an i

[PATCH 06/15] hw/nvme: Add support for Primary Controller Capabilities

2021-10-07 Thread Lukasz Maniak
Implementation of Primary Controller Capabilities data structure (Identify command with CNS value of 14h). Currently, the command returns only ID of a primary controller. Handling of remaining fields are added in subsequent patches implementing virtualization enhancements. Signed-off-by: Lukasz M

[PATCH 13/15] pcie: Add helpers to the SR/IOV API

2021-10-07 Thread Lukasz Maniak
From: Łukasz Gieryk Two convenience functions for retrieving: - the total number of VFs, - the PCIDevice object of the N-th VF. Signed-off-by: Łukasz Gieryk --- hw/pci/pcie_sriov.c | 14 ++ include/hw/pci/pcie_sriov.h | 8 2 files changed, 22 insertions(+) diff

[PATCH 12/15] hw/nvme: Initialize capability structures for primary/secondary controllers

2021-10-07 Thread Lukasz Maniak
From: Łukasz Gieryk With two new properties (sriov_max_vi_per_vf, sriov_max_vq_per_vf) one can configure the maximum number of virtual queues and interrupts assignable to a single virtual device. The primary and secondary controller capability structures are initialized accordingly. Since the nu

[PATCH 08/15] pcie: Add 1.2 version token for the Power Management Capability

2021-10-07 Thread Lukasz Maniak
From: Łukasz Gieryk Signed-off-by: Łukasz Gieryk --- include/hw/pci/pci_regs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/pci/pci_regs.h b/include/hw/pci/pci_regs.h index 77ba64b931..a590140962 100644 --- a/include/hw/pci/pci_regs.h +++ b/include/hw/pci/pci_regs.h @@ -4,5 +4

[PATCH 05/15] hw/nvme: Add support for SR-IOV

2021-10-07 Thread Lukasz Maniak
This patch implements initial support for Single Root I/O Virtualization on an NVMe device. Essentially, it allows to define the maximum number of virtual functions supported by the NVMe controller via sriov_max_vfs parameter. Passing a non-zero value to sriov_max_vfs triggers reporting of SR-IOV

[PATCH 02/15] pcie: Add support for Single Root I/O Virtualization (SR/IOV)

2021-10-07 Thread Lukasz Maniak
From: Knut Omang This patch provides the building blocks for creating an SR/IOV PCIe Extended Capability header and register/unregister SR/IOV Virtual Functions. Signed-off-by: Knut Omang --- hw/pci/meson.build | 1 + hw/pci/pci.c| 97 +--- hw/pci/pcie.c

[PATCH 00/15] hw/nvme: SR-IOV with Virtualization Enhancements

2021-10-07 Thread Lukasz Maniak
Hi, This series of patches is an attempt to add support for the following sections of NVMe specification revision 1.4: 8.5 Virtualization Enhancements (Optional) 8.5.1 VQ Resource Definition 8.5.2 VI Resource Definition 8.5.3 Secondary Controller States and Resource Configuration

[PATCH 01/15] pcie: Set default and supported MaxReadReq to 512

2021-10-07 Thread Lukasz Maniak
From: Knut Omang Make the default PCI Express Capability for PCIe devices set MaxReadReq to 512. Tyipcal modern devices people would want to emulate or simulate would want this. The previous value would cause warnings from the root port driver on some kernels. Signed-off-by: Knut Omang --- hw/

[PATCH 04/15] pcie: Add callback preceding SR-IOV VFs update

2021-10-07 Thread Lukasz Maniak
PCIe devices implementing SR-IOV may need to perform certain actions before the VFs are unrealized or vice versa. Signed-off-by: Lukasz Maniak --- docs/pcie_sriov.txt | 2 +- hw/pci/pcie_sriov.c | 14 +- include/hw/pci/pcie_sriov.h | 8 +++- 3 files changed, 21

[PATCH 03/15] pcie: Add some SR/IOV API documentation in docs/pcie_sriov.txt

2021-10-07 Thread Lukasz Maniak
From: Knut Omang Add a small intro + minimal documentation for how to implement SR/IOV support for an emulated device. Signed-off-by: Knut Omang --- docs/pcie_sriov.txt | 115 1 file changed, 115 insertions(+) create mode 100644 docs/pcie_sriov.txt

Re: [PATCH 1/2] pylint: fix errors and warnings from qemu-tests test 297

2021-10-07 Thread Kevin Wolf
Am 07.10.2021 um 12:34 hat Emanuele Giuseppe Esposito geschrieben: > > > > The error is "C0330: Wrong hanging indentation" > > > so it is not about dicts. I guess we can disable the error, but the > > > problem > > > is that we will disable it for the whole file, which doesn't seem right. > > >

Re: [PATCH v2 12/17] python/machine: Handle QMP errors on close more meticulously

2021-10-07 Thread John Snow
On Wed, Sep 22, 2021 at 8:50 PM John Snow wrote: > To use the AQMP backend, Machine just needs to be a little more diligent > about what happens when closing a QMP connection. The operation is no > longer a freebie in the async world; it may return errors encountered in > the async bottom half on

Re: [PATCH v2 12/17] python/machine: Handle QMP errors on close more meticulously

2021-10-07 Thread John Snow
On Thu, Oct 7, 2021 at 11:08 AM Eric Blake wrote: > On Wed, Sep 22, 2021 at 08:49:33PM -0400, John Snow wrote: > > To use the AQMP backend, Machine just needs to be a little more diligent > > about what happens when closing a QMP connection. The operation is no > > longer a freebie in the async w

Re: [PATCH v3 00/17] iotests: support zstd

2021-10-07 Thread Vladimir Sementsov-Ogievskiy
9/14/21 20:08, Hanna Reitz wrote: On 14.09.21 12:25, Vladimir Sementsov-Ogievskiy wrote: These series makes tests pass with     IMGOPTS='compression_type=zstd' Also, python iotests start to support IMGOPTS (they didn't before). v3: 02-04,06,08,14,17: add Hanna's r-b 07  iotests.py: filter out

Re: [PATCH v2 04/17] python/aqmp: add send_fd_scm

2021-10-07 Thread John Snow
On Thu, Oct 7, 2021 at 10:52 AM Eric Blake wrote: > On Wed, Sep 22, 2021 at 08:49:25PM -0400, John Snow wrote: > > The single space is indeed required to successfully transmit the file > > descriptor to QEMU. > > Sending fds requires a payload of at least one byte, but I don't think > that qemu c

Re: [PATCH V3] block/rbd: implement bdrv_co_block_status

2021-10-07 Thread Peter Lieven
Am 05.10.21 um 10:36 schrieb Ilya Dryomov: On Tue, Oct 5, 2021 at 10:19 AM Peter Lieven wrote: Am 05.10.21 um 09:54 schrieb Ilya Dryomov: On Thu, Sep 16, 2021 at 2:21 PM Peter Lieven wrote: the qemu rbd driver currently lacks support for bdrv_co_block_status. This results mainly in incorrect

[PATCH V4] block/rbd: implement bdrv_co_block_status

2021-10-07 Thread Peter Lieven
the qemu rbd driver currently lacks support for bdrv_co_block_status. This results mainly in incorrect progress during block operations (e.g. qemu-img convert with an rbd image as source). This patch utilizes the rbd_diff_iterate2 call from librbd to detect allocated and unallocated (all zero area

Re: [PATCH v2 0/3] virtio: increase VIRTQUEUE_MAX_SIZE to 32k

2021-10-07 Thread Stefan Hajnoczi
On Thu, Oct 07, 2021 at 02:51:55PM +0200, Christian Schoenebeck wrote: > On Donnerstag, 7. Oktober 2021 07:23:59 CEST Stefan Hajnoczi wrote: > > On Mon, Oct 04, 2021 at 09:38:00PM +0200, Christian Schoenebeck wrote: > > > At the moment the maximum transfer size with virtio is limited to 4M > > > (1

[PULL v2 09/15] job: Do not soft-cancel after a job is done

2021-10-07 Thread Vladimir Sementsov-Ogievskiy
From: Hanna Reitz The only job that supports a soft cancel mode is the mirror job, and in such a case it resets its .cancelled field before it leaves its .run() function, so it does not really count as cancelled. However, it is possible to cancel the job after .run() returns and before job_exit(

[PULL v2 10/15] job: Add job_cancel_requested()

2021-10-07 Thread Vladimir Sementsov-Ogievskiy
From: Hanna Reitz Most callers of job_is_cancelled() actually want to know whether the job is on its way to immediate termination. For example, we refuse to pause jobs that are cancelled; but this only makes sense for jobs that are really actually cancelled. A mirror job that is cancelled durin

[PULL v2 02/15] block/aio_task: assert `max_busy_tasks` is greater than 0

2021-10-07 Thread Vladimir Sementsov-Ogievskiy
From: Stefano Garzarella All code in block/aio_task.c expects `max_busy_tasks` to always be greater than 0. Assert this condition during the AioTaskPool creation where `max_busy_tasks` is set. Signed-off-by: Stefano Garzarella Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20211005161

[PULL v2 01/15] block/backup: avoid integer overflow of `max-workers`

2021-10-07 Thread Vladimir Sementsov-Ogievskiy
From: Stefano Garzarella QAPI generates `struct BackupPerf` where `max-workers` value is stored in an `int64_t` variable. But block_copy_async(), and the underlying code, uses an `int` parameter. At the end that variable is used to initialize `max_busy_tasks` in block/aio_task.c causing the foll

[PULL v2 00/15] jobs: mirror: Handle errors after READY cancel

2021-10-07 Thread Vladimir Sementsov-Ogievskiy
The following changes since commit 9618c5badaa8eed25259cf095ff880efb939fbe7: Merge remote-tracking branch 'remotes/vivier/tags/trivial-branch-for-6.2-pull-request' into staging (2021-10-04 16:27:35 -0700) are available in the Git repository at: https://src.openvz.org/scm/~vsementsov/qemu.g

Re: [PATCH v2 1/3] virtio: turn VIRTQUEUE_MAX_SIZE into a variable

2021-10-07 Thread Stefan Hajnoczi
On Thu, Oct 07, 2021 at 03:09:16PM +0200, Christian Schoenebeck wrote: > On Mittwoch, 6. Oktober 2021 16:42:34 CEST Stefan Hajnoczi wrote: > > On Wed, Oct 06, 2021 at 02:50:07PM +0200, Christian Schoenebeck wrote: > > > On Mittwoch, 6. Oktober 2021 13:06:55 CEST Stefan Hajnoczi wrote: > > > > On Tu

Re: [PATCH v2 07/17] python/aqmp: Disable logging messages by default

2021-10-07 Thread Eric Blake
On Wed, Sep 22, 2021 at 08:49:28PM -0400, John Snow wrote: > AQMP is a library, and ideally it should not print error diagnostics > unless a user opts into seeing them. By default, Python will print all > WARNING, ERROR or CRITICAL messages to screen if no logging > configuration has been created b

Re: [PATCH v2 12/17] python/machine: Handle QMP errors on close more meticulously

2021-10-07 Thread Eric Blake
On Wed, Sep 22, 2021 at 08:49:33PM -0400, John Snow wrote: > To use the AQMP backend, Machine just needs to be a little more diligent > about what happens when closing a QMP connection. The operation is no > longer a freebie in the async world; it may return errors encountered in > the async bottom

Re: [PATCH v2 06/17] python/aqmp: Reduce severity of EOFError-caused loop terminations

2021-10-07 Thread Eric Blake
On Wed, Sep 22, 2021 at 08:49:27PM -0400, John Snow wrote: > When we encounter an EOFError, we don't know if it's an "error" in the > perspective of the user of the library yet. Therefore, we should not log > it as an error. Reduce the severity of this logging message to "INFO" to > indicate that i

Re: [RFC PATCH v2 25/25] job.h: assertions in the callers of JobDriver funcion pointers

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:15AM -0400, Emanuele Giuseppe Esposito wrote: > Signed-off-by: Emanuele Giuseppe Esposito > --- > job.c | 9 + > 1 file changed, 9 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [RFC PATCH v2 24/25] job.h: split function pointers in JobDriver

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:14AM -0400, Emanuele Giuseppe Esposito wrote: > The job API will be handled separately in another serie. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > include/qemu/job.h | 31 +++ > 1 file changed, 31 insertions(+) > > diff --git

Re: [RFC PATCH v2 21/25] block_int-common.h: split function pointers in BdrvChildClass

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:11AM -0400, Emanuele Giuseppe Esposito wrote: > Signed-off-by: Emanuele Giuseppe Esposito > --- > include/block/block_int-common.h | 65 ++-- > 1 file changed, 46 insertions(+), 19 deletions(-) Reviewed-by: Stefan Hajnoczi signature.as

Re: [RFC PATCH v2 20/25] block_int-common.h: assertion in the callers of BlockDriver function pointers

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:10AM -0400, Emanuele Giuseppe Esposito wrote: > Signed-off-by: Emanuele Giuseppe Esposito > --- > block.c | 16 > 1 file changed, 16 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH v2 04/17] python/aqmp: add send_fd_scm

2021-10-07 Thread Eric Blake
On Wed, Sep 22, 2021 at 08:49:25PM -0400, John Snow wrote: > The single space is indeed required to successfully transmit the file > descriptor to QEMU. Sending fds requires a payload of at least one byte, but I don't think that qemu cares which byte. Thus, while your choice of space is fine, the

Re: [PATCH v2 05/17] python/aqmp: Add dict conversion method to Greeting object

2021-10-07 Thread Eric Blake
On Wed, Sep 22, 2021 at 08:49:26PM -0400, John Snow wrote: > The iotests interface expects to return the greeting as a dict; AQMP > offers it as a rich object. > > Signed-off-by: John Snow > --- > python/qemu/aqmp/models.py | 13 + > 1 file changed, 13 insertions(+) Reviewed-by: Eri

Re: [RFC PATCH v2 23/25] block-backend-common.h: split function pointers in BlockDevOps

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:13AM -0400, Emanuele Giuseppe Esposito wrote: > Assertions in the callers of the funciton pointrs are already > added by previous patches. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > include/sysemu/block-backend-common.h | 42 +++ >

Re: [RFC PATCH v2 22/25] block_int-common.h: assertions in the callers of BdrvChildClass function pointers

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:12AM -0400, Emanuele Giuseppe Esposito wrote: > Signed-off-by: Emanuele Giuseppe Esposito > --- > block.c | 10 ++ > 1 file changed, 10 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [RFC PATCH v2 19/25] block_int-common.h: split function pointers in BlockDriver

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:09AM -0400, Emanuele Giuseppe Esposito wrote: > Similar to the header split, also the function pointers in BlockDriver > can be split in I/O and global state. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > include/block/block_int-common.h | 472 ++

Re: [RFC PATCH v2 18/25] block/coroutines: I/O API

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:08AM -0400, Emanuele Giuseppe Esposito wrote: > block coroutines functions run in different aiocontext, and are > not protected by the BQL. Therefore are I/O. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > block/coroutines.h | 6 ++ > 1 file changed, 6 in

Re: [RFC PATCH v2 17/25] include/block/transactions: global state API + assertions

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:07AM -0400, Emanuele Giuseppe Esposito wrote: > transactions run always under the BQL lock, so they are all > in the global state API. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > include/qemu/transactions.h | 24 > util/transaction

Re: [RFC PATCH v2 15/25] include/block/snapshot: global state API + assertions

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:05AM -0400, Emanuele Giuseppe Esposito wrote: > Snapshots run also under the BQL lock, so they all are > in the global state API. The aiocontext lock that they hold > is currently an overkill and in future could be removed. > > Signed-off-by: Emanuele Giuseppe Esposit

Re: [RFC PATCH v2 16/25] block/backup-top.h: global state API + assertions

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:06AM -0400, Emanuele Giuseppe Esposito wrote: > backup-top functions always run under BQL lock. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > block/backup-top.c | 2 ++ > block/backup-top.h | 11 +++ > 2 files changed, 13 insertions(+) Reviewed-by:

Re: [RFC PATCH v2 13/25] include/systemu/blockdev.h: global state API

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:03AM -0400, Emanuele Giuseppe Esposito wrote: > blockdev functions run always under the BQL lock. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > include/sysemu/blockdev.h | 35 ++- > 1 file changed, 30 insertions(+), 5 deletion

Re: [RFC PATCH v2 14/25] assertions for blockdev.h global state API

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:04AM -0400, Emanuele Giuseppe Esposito wrote: > Signed-off-by: Emanuele Giuseppe Esposito > --- > block/block-backend.c | 2 ++ > blockdev.c| 12 > 2 files changed, 14 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description:

Re: [RFC PATCH v2 12/25] assertions for blockob.h global state API

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:02AM -0400, Emanuele Giuseppe Esposito wrote: > Signed-off-by: Emanuele Giuseppe Esposito > --- > blockjob.c | 10 ++ > 1 file changed, 10 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [RFC PATCH v2 11/25] include/block/blockjob.h: global state API

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:01AM -0400, Emanuele Giuseppe Esposito wrote: > blockjob functions run always under the BQL lock. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > include/block/blockjob.h | 23 +++ > 1 file changed, 23 insertions(+) > > diff --git a/includ

Re: [RFC PATCH v2 10/25] assertions for blockjob_int.h

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:32:00AM -0400, Emanuele Giuseppe Esposito wrote: > Signed-off-by: Emanuele Giuseppe Esposito > --- > blockjob.c | 4 > 1 file changed, 4 insertions(+) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [RFC PATCH v2 09/25] include/block/blockjob_int.h: split header into I/O and GS API

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:31:59AM -0400, Emanuele Giuseppe Esposito wrote: > Since the I/O functions are not many, keep a single file. > Also split the function pointers in BlockJobDriver. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > include/block/blockjob_int.h | 55 ++

Re: [RFC PATCH v2 07/25] assertions for block_int global state API

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:31:57AM -0400, Emanuele Giuseppe Esposito wrote: > Signed-off-by: Emanuele Giuseppe Esposito > --- > block.c | 17 + > block/backup.c | 1 + > block/block-backend.c | 3 +++ > block/commit.c

Re: [RFC PATCH v2 08/25] block: introduce assert_bdrv_graph_writable

2021-10-07 Thread Stefan Hajnoczi
On Thu, Oct 07, 2021 at 03:47:42PM +0200, Emanuele Giuseppe Esposito wrote: > > > On 07/10/2021 14:02, Paolo Bonzini wrote: > > > --- a/block/io.c > > > +++ b/block/io.c > > > @@ -739,6 +739,11 @@ void bdrv_drain_all(void) > > >   bdrv_drain_all_end(); > > >   } > > > +void assert_bdrv_graph_

Re: [RFC PATCH 0/4] aio: AIO_CONTEXT_ACQUIRE_GUARD() macro experiment

2021-10-07 Thread Philippe Mathieu-Daudé
On 10/7/21 15:15, Stefan Hajnoczi wrote: > On Tue, Oct 05, 2021 at 08:58:03PM +0200, Philippe Mathieu-Daudé wrote: >> Experiment to use glib g_autoptr/autofree features with >> AIO context. >> Since this is a RFC, only few examples are provided. >> >> TODO: Document the macros in docs/devel/multipl

Re: [RFC PATCH v2 08/25] block: introduce assert_bdrv_graph_writable

2021-10-07 Thread Emanuele Giuseppe Esposito
On 07/10/2021 14:02, Paolo Bonzini wrote: --- a/block/io.c +++ b/block/io.c @@ -739,6 +739,11 @@ void bdrv_drain_all(void)   bdrv_drain_all_end();   } +void assert_bdrv_graph_writable(BlockDriverState *bs) +{ +    g_assert(qatomic_read(&bs->quiesce_counter) > 0 || qemu_in_main_thread());

Re: [RFC PATCH v2 06/25] include/block/block_int: split header into I/O and global state API

2021-10-07 Thread Stefan Hajnoczi
On Thu, Oct 07, 2021 at 01:30:42PM +0200, Emanuele Giuseppe Esposito wrote: > > > On 07/10/2021 12:52, Stefan Hajnoczi wrote: > > On Tue, Oct 05, 2021 at 10:31:56AM -0400, Emanuele Giuseppe Esposito wrote: > > > +int coroutine_fn bdrv_co_copy_range_from(BdrvChild *src, int64_t > > > src_offset,

Re: [PATCH 5/5] block/nvme: Fix memory leak from nvme_init_queue()

2021-10-07 Thread Philippe Mathieu-Daudé
On 10/7/21 15:29, Stefan Hajnoczi wrote: > On Wed, Oct 06, 2021 at 06:49:31PM +0200, Philippe Mathieu-Daudé wrote: >> nvme_create_queue_pair() allocates resources with qemu_vfio_dma_map(), >> but we never release them. Do it in nvme_free_queue() which is called >> from nvme_free_queue_pair(). >> >>

Re: [PATCH 2/5] block/nvme: Display CQ/SQ pointer in nvme_free_queue_pair()

2021-10-07 Thread Stefan Hajnoczi
On Wed, Oct 06, 2021 at 06:49:28PM +0200, Philippe Mathieu-Daudé wrote: > For debugging purpose it is helpful to know the CQ/SQ pointers. > We already have a trace event in nvme_free_queue_pair(), extend > it to report these pointer addresses. > > Signed-off-by: Philippe Mathieu-Daudé > --- > bl

Re: [PATCH 1/5] block/nvme: Automatically free qemu_memalign() with QEMU_AUTO_VFREE

2021-10-07 Thread Stefan Hajnoczi
On Wed, Oct 06, 2021 at 06:49:27PM +0200, Philippe Mathieu-Daudé wrote: > Since commit 4d324c0bf65 ("introduce QEMU_AUTO_VFREE") buffers > allocated by qemu_memalign() can automatically freed when using > the QEMU_AUTO_VFREE macro. Use it to simplify a bit. > > Signed-off-by: Philippe Mathieu-Daud

Re: [PATCH 4/5] block/nvme: Pass BDRVNVMeState* handle to nvme_free_queue_pair()

2021-10-07 Thread Stefan Hajnoczi
On Wed, Oct 06, 2021 at 06:49:30PM +0200, Philippe Mathieu-Daudé wrote: > In the next commit we want to access BDRVNVMeState from > nvme_free_queue_pair() callee. Pass it along first. > > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 14 +++--- > 1 file changed, 7 insertio

Re: [PATCH 5/5] block/nvme: Fix memory leak from nvme_init_queue()

2021-10-07 Thread Stefan Hajnoczi
On Wed, Oct 06, 2021 at 06:49:31PM +0200, Philippe Mathieu-Daudé wrote: > nvme_create_queue_pair() allocates resources with qemu_vfio_dma_map(), > but we never release them. Do it in nvme_free_queue() which is called > from nvme_free_queue_pair(). > > Reported by valgrind: > > ==252858== 520,19

Re: [PATCH 3/5] block/nvme: Extract nvme_free_queue() from nvme_free_queue_pair()

2021-10-07 Thread Stefan Hajnoczi
On Wed, Oct 06, 2021 at 06:49:29PM +0200, Philippe Mathieu-Daudé wrote: > Instead of duplicating code, extract the common helper to free > a single queue. > > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) Reviewed-by:

Re: [PATCH v7 7/8] qmp: add QMP command x-debug-virtio-queue-element

2021-10-07 Thread Eric Blake
On Tue, Oct 05, 2021 at 12:45:52PM -0400, Jonah Palmer wrote: > From: Laurent Vivier > > This new command shows the information of a VirtQueue element. > > Signed-off-by: Jonah Palmer > --- > +++ b/qapi/virtio.json > +## > +# @VirtioRingAvail: > +# > +# @flags: VRingAvail flags > +# > +# @idx:

Re: [RFC PATCH v2 04/25] include/block/block: split header into I/O and global state API

2021-10-07 Thread Eric Blake
On Thu, Oct 07, 2021 at 01:51:33PM +0200, Paolo Bonzini wrote: > On 07/10/21 12:54, Emanuele Giuseppe Esposito wrote: > > > > > > > +int bdrv_block_status(BlockDriverState *bs, int64_t offset, > > > > +  int64_t bytes, int64_t *pnum, int64_t *map, > > > > + 

Re: [RFC PATCH 0/4] aio: AIO_CONTEXT_ACQUIRE_GUARD() macro experiment

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 08:58:03PM +0200, Philippe Mathieu-Daudé wrote: > Experiment to use glib g_autoptr/autofree features with > AIO context. > Since this is a RFC, only few examples are provided. > > TODO: Document the macros in docs/devel/multiple-iothreads.txt > > Philippe Mathieu-Daudé (4)

Re: [PATCH v2 1/3] virtio: turn VIRTQUEUE_MAX_SIZE into a variable

2021-10-07 Thread Christian Schoenebeck
On Mittwoch, 6. Oktober 2021 16:42:34 CEST Stefan Hajnoczi wrote: > On Wed, Oct 06, 2021 at 02:50:07PM +0200, Christian Schoenebeck wrote: > > On Mittwoch, 6. Oktober 2021 13:06:55 CEST Stefan Hajnoczi wrote: > > > On Tue, Oct 05, 2021 at 06:32:46PM +0200, Christian Schoenebeck wrote: > > > > On Di

Re: [RFC PATCH v2 04/25] include/block/block: split header into I/O and global state API

2021-10-07 Thread Stefan Hajnoczi
On Thu, Oct 07, 2021 at 12:43:43PM +0100, Daniel P. Berrangé wrote: > On Tue, Oct 05, 2021 at 10:31:54AM -0400, Emanuele Giuseppe Esposito wrote: > > Similarly to the previous patch, split block.h > > in block-io.h and block-global-state.h > > > > block-common.h contains the structures shared betw

Re: [PATCH v2 0/3] virtio: increase VIRTQUEUE_MAX_SIZE to 32k

2021-10-07 Thread Christian Schoenebeck
On Donnerstag, 7. Oktober 2021 07:23:59 CEST Stefan Hajnoczi wrote: > On Mon, Oct 04, 2021 at 09:38:00PM +0200, Christian Schoenebeck wrote: > > At the moment the maximum transfer size with virtio is limited to 4M > > (1024 * PAGE_SIZE). This series raises this limit to its maximum > > theoretical

Re: [RFC PATCH v2 15/25] include/block/snapshot: global state API + assertions

2021-10-07 Thread Paolo Bonzini
On 05/10/21 16:32, Emanuele Giuseppe Esposito wrote: Snapshots run also under the BQL lock, so they all are in the global state API. The aiocontext lock that they hold is currently an overkill and in future could be removed. Signed-off-by: Emanuele Giuseppe Esposito --- block/snapshot.c

Re: [RFC PATCH v2 16/25] block/backup-top.h: global state API + assertions

2021-10-07 Thread Paolo Bonzini
On 05/10/21 16:32, Emanuele Giuseppe Esposito wrote: backup-top functions always run under BQL lock. Signed-off-by: Emanuele Giuseppe Esposito --- block/backup-top.c | 2 ++ block/backup-top.h | 11 +++ 2 files changed, 13 insertions(+) diff --git a/block/backup-top.c b/block/back

Re: [RFC PATCH v2 14/25] assertions for blockdev.h global state API

2021-10-07 Thread Paolo Bonzini
On 05/10/21 16:32, Emanuele Giuseppe Esposito wrote: Signed-off-by: Emanuele Giuseppe Esposito --- block/block-backend.c | 2 ++ blockdev.c| 12 2 files changed, 14 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index 9f09245069..18791c4fd

Re: [RFC PATCH v2 08/25] block: introduce assert_bdrv_graph_writable

2021-10-07 Thread Paolo Bonzini
On 05/10/21 16:31, Emanuele Giuseppe Esposito wrote: We want to be sure that the functions that write the child and parent list of a bs are either under BQL or drain. If this guarantee holds, then we can read the list also in the I/O APIs. Signed-off-by: Emanuele Giuseppe Esposito --- block.c

Re: [RFC PATCH v2 08/25] block: introduce assert_bdrv_graph_writable

2021-10-07 Thread Paolo Bonzini
On 05/10/21 16:31, Emanuele Giuseppe Esposito wrote: We want to be sure that the functions that write the child and parent list of a bs are either under BQL or drain. If this guarantee holds, then we can read the list also in the I/O APIs. Signed-off-by: Emanuele Giuseppe Esposito --- block.c

Re: [RFC PATCH v2 13/25] include/systemu/blockdev.h: global state API

2021-10-07 Thread Paolo Bonzini
On 05/10/21 16:32, Emanuele Giuseppe Esposito wrote: DriveInfo *drive_get_next(BlockInterfaceType type); +DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type, + Error **errp); + +/* Common functions that are neither I/O nor Global State */ + +DriveI

Re: [RFC PATCH v2 18/25] block/coroutines: I/O API

2021-10-07 Thread Paolo Bonzini
On 05/10/21 16:32, Emanuele Giuseppe Esposito wrote: block coroutines functions run in different aiocontext, and are not protected by the BQL. Therefore are I/O. Signed-off-by: Emanuele Giuseppe Esposito --- block/coroutines.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/c

Re: [RFC PATCH v2 04/25] include/block/block: split header into I/O and global state API

2021-10-07 Thread Paolo Bonzini
On 07/10/21 12:54, Emanuele Giuseppe Esposito wrote: +int bdrv_block_status(BlockDriverState *bs, int64_t offset, +  int64_t bytes, int64_t *pnum, int64_t *map, +  BlockDriverState **file); This function just called bdrv_block_status_above(), which is i

Re: [PATCH] qemu-iotests: flush after every test

2021-10-07 Thread Paolo Bonzini
On 06/10/21 17:42, Philippe Mathieu-Daudé wrote: On 10/6/21 11:27, Paolo Bonzini wrote: This makes it possible to see what is happening, even if the output of "make check-block" is not sent to a tty (for example if it is sent to grep or tee). Signed-off-by: Paolo Bonzini --- tests/qemu-iotes

Re: [RFC PATCH v2 04/25] include/block/block: split header into I/O and global state API

2021-10-07 Thread Daniel P . Berrangé
On Tue, Oct 05, 2021 at 10:31:54AM -0400, Emanuele Giuseppe Esposito wrote: > Similarly to the previous patch, split block.h > in block-io.h and block-global-state.h > > block-common.h contains the structures shared between > the two headers, and the functions that can't be categorized as > I/O or

Re: [RFC PATCH v2 06/25] include/block/block_int: split header into I/O and global state API

2021-10-07 Thread Emanuele Giuseppe Esposito
On 07/10/2021 12:52, Stefan Hajnoczi wrote: On Tue, Oct 05, 2021 at 10:31:56AM -0400, Emanuele Giuseppe Esposito wrote: +int coroutine_fn bdrv_co_copy_range_from(BdrvChild *src, int64_t src_offset, + BdrvChild *dst, int64_t dst_offset, +

Re: [RFC PATCH v2 04/25] include/block/block: split header into I/O and global state API

2021-10-07 Thread Emanuele Giuseppe Esposito
On 07/10/2021 11:33, Stefan Hajnoczi wrote: On Tue, Oct 05, 2021 at 10:31:54AM -0400, Emanuele Giuseppe Esposito wrote: +int bdrv_pwrite_sync(BdrvChild *child, int64_t offset, + const void *buf, int64_t bytes); Why is this bit of a surprise since the other synchronous I/

Re: [RFC PATCH v2 06/25] include/block/block_int: split header into I/O and global state API

2021-10-07 Thread Stefan Hajnoczi
On Tue, Oct 05, 2021 at 10:31:56AM -0400, Emanuele Giuseppe Esposito wrote: > +int coroutine_fn bdrv_co_copy_range_from(BdrvChild *src, int64_t src_offset, > + BdrvChild *dst, int64_t dst_offset, > + int64_t bytes, > +

  1   2   >