[Qemu-block] [PATCH 22/33] tests/qgraph: virtio-9p test node

2018-08-13 Thread Emanuele Giuseppe Esposito
Add qgraph nodes for virtio-9p-pci and virtio-9p-device. Both nodes produce virtio-9p, but virtio-9p-pci receives a pci-bus and uses virtio-pci QOSGraphObject and functions, while virtio-9p-device receives a virtio and implements its own functions Signed-off-by: Emanuele Giuseppe Esposito

[Qemu-block] [PATCH 01/33] tests: qgraph API for the qtest driver framework

2018-08-13 Thread Emanuele Giuseppe Esposito
drivers/machines, discover the path and run tests. graph.h provides the public API to manage the graph nodes/edges graph_extra.h provides a more private API used successively by the gtest integration part qos-test.c provides the main executable Signed-off-by: Emanuele Giuseppe Esposito

[Qemu-block] [PATCH 07/33] tests/qgraph: arm/raspi2 machine node

2018-08-13 Thread Emanuele Giuseppe Esposito
Add arm/raspi2 machine to the graph. This machine contains a generic-sdhci, so its constructor must take care of setting it properly when called. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include| 1 + tests/libqos/raspi2-machine.c | 82

[Qemu-block] [PATCH 11/33] tests/qgraph: e1000e driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
Add qgraph nodes for virtio-e1000e. It consumes a pci-bus, and it's directly used by tests (e1000e is pci based). Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 1 + tests/libqos/e1000e.c | 262 + tests/libqos/e1000e.h | 53

[Qemu-block] [PATCH 05/33] tests/qgraph: sdhci driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
Add qgraph nodes for sdhci-pci and generic-sdhci (memory mapped) drivers. Both drivers implement (produce) the same interface sdhci, that provides the readw - readq - writeq functions. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 1 + tests/libqos/sdhci.c | 163

[Qemu-block] [PATCH 06/33] tests/qgraph: sdhci test node

2018-08-13 Thread Emanuele Giuseppe Esposito
Giuseppe Esposito --- tests/Makefile.include | 9 +- tests/sdhci-test.c | 222 - 2 files changed, 68 insertions(+), 163 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 90a74854b8..c4c7c8d56a 100644 --- a/tests

[Qemu-block] [PATCH 14/33] tests/qgraph: virtio-pci driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
Add QOSGraphObject to QVirtioPCIDevice structure, with a basic constructor. virtio-pci is not present in qgraph, since it will be used as starting point by its subclasses (virtio-*-pci) Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include| 2 +- tests/libqos/virtio-pci.c

[Qemu-block] [PATCH 12/33] tests/qgraph: e1000e-test node

2018-08-13 Thread Emanuele Giuseppe Esposito
Giuseppe Esposito --- tests/Makefile.include | 3 +- tests/e1000e-test.c| 354 + 2 files changed, 78 insertions(+), 279 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 9f0d64f4ae..e18796d8d8 100644 --- a/tests

[Qemu-block] [PATCH 33/33] tests/qgraph: temporarly commented vhost-user-test

2018-08-13 Thread Emanuele Giuseppe Esposito
vhost-user-test has not converted to qgraph yet, and since it uses virtio interface, it won't work, causing make check to fail. Commented out until it does not get converted to graph node. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 8 1 file changed, 4

[Qemu-block] [PATCH 27/33] tests/qgraph: virtio-blk driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
Add qgraph nodes for virtio-blk-pci and virtio-blk-device. Both nodes produce virtio-blk, but virtio-blk-pci receives a pci-bus and uses virtio-pci QOSGraphObject and functions, while virtio-blk-device receives a virtio and implements its own functions Signed-off-by: Emanuele Giuseppe Esposito

[Qemu-block] [PATCH 18/33] tests/qgraph: virtio-serial driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
+ * + * Copyright (c) 2018 Emanuele Giuseppe Esposito + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope

[Qemu-block] [PATCH 20/33] tests/qgraph: virtio-serial test node

2018-08-13 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 4 +--- tests/virtio-serial-test.c | 27 +-- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index a160059758..eafceefc12 100644

[Qemu-block] [PATCH 15/33] tests/qgraph: virtio-mmio driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
lso rename qvirtio_mmio_init_device in qvirtio_mmio_device_new, since the function actually allocates a new QVirtioMMIODevice and initialize it. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Laurent Vivier --- tests/libqos/virtio-mmio.c | 66 ++ tests/libqos/virtio-m

[Qemu-block] [PATCH 13/33] tests/qgraph: virtio_start_device function

2018-08-13 Thread Emanuele Giuseppe Esposito
This function is intended to group all the qvirtio_* functions that start the qvirtio devices. Applied in all tests using this combination of functions. Signed-off-by: Emanuele Giuseppe Esposito --- tests/libqos/virtio.c| 7 +++ tests/libqos/virtio.h| 1 + tests/vhost-user-test.c

[Qemu-block] [PATCH 25/33] tests/qgraph: virtio-rng driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
Add qgraph nodes for virtio-rng-pci and virtio-rng-device. Both nodes produce virtio-rng, but virtio-rng-pci receives a pci-bus and uses virtio-pci QOSGraphObject and functions, while virtio-rng-device receives a virtio and implements its own functions Signed-off-by: Emanuele Giuseppe Esposito

[Qemu-block] [PATCH 16/33] tests/qgraph: arm/virt machine node

2018-08-13 Thread Emanuele Giuseppe Esposito
Add arm/virt machine to the graph. This machine contains virtio-mmio, so its constructor must take care of setting it properly when called. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 1 + tests/libqos/virt-machine.c | 90 + 2

[Qemu-block] [PATCH 23/33] tests/qgraph: virtio-balloon driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
file mode 100644 index 00..98d2548ffe --- /dev/null +++ b/tests/libqos/virtio-balloon.c @@ -0,0 +1,111 @@ +/* + * libqos driver framework + * + * Copyright (c) 2018 Emanuele Giuseppe Esposito + * + * This library is free software; you can redistribute it and/or + * modify it under the terms

[Qemu-block] [PATCH 28/33] tests/qgraph: virtio-blk test node

2018-08-13 Thread Emanuele Giuseppe Esposito
does not allocate any virtio-blk structure, it's all done by the qtest walking graph mechanism Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 4 +- tests/virtio-blk-test.c | 468 2 files changed, 190 insertions(+), 282 deletions

[Qemu-block] [PATCH 19/33] tests/qgraph: virtio-console test node

2018-08-13 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 5 +++-- tests/libqos/virtio.c | 1 + tests/virtio-console-test.c | 30 +++--- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/tests/Makefile.include b/tests

[Qemu-block] [PATCH 29/33] tests/qgraph: virtio-net driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
new file mode 100644 index 00..332d121486 --- /dev/null +++ b/tests/libqos/virtio-net.c @@ -0,0 +1,179 @@ +/* + * libqos driver framework + * + * Copyright (c) 2018 Emanuele Giuseppe Esposito + * + * This library is free software; you can redistribute it and/or + * modify it under the terms

[Qemu-block] [PATCH 32/33] tests/qgraph: virtio-scsi test node

2018-08-13 Thread Emanuele Giuseppe Esposito
that this test does not allocate any virtio-scsi structure, it's all done by the qtest walking graph mechanism Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +- tests/virtio-scsi-test.c | 153 +++ 2 files changed, 75 insertions(+), 81

[Qemu-block] [PATCH 26/33] tests/qgraph: virtio-rng test node

2018-08-13 Thread Emanuele Giuseppe Esposito
does not allocate any virtio-rng structure, it's all done by the qtest walking graph mechanism Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/virtio-rng-test.c | 25 + 2 files changed, 10 insertions(+), 18 deletions(-) diff --git

[Qemu-block] [PATCH 24/33] tests/qgraph: virtio-balloon test node

2018-08-13 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 4 +--- tests/virtio-balloon-test.c | 22 +++--- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 362d9ec4b2..b23597972d 100644

[Qemu-block] [PATCH 21/33] tests/qgraph: virtio-9p driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
..df60db8f39 --- /dev/null +++ b/tests/libqos/virtio-9p.c @@ -0,0 +1,165 @@ +/* + * libqos driver framework + * + * Copyright (c) 2018 Emanuele Giuseppe Esposito + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License

[Qemu-block] [PATCH 31/33] tests/qgraph: virtio-scsi driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
/virtio-scsi.c new file mode 100644 index 00..8f13c0bfaf --- /dev/null +++ b/tests/libqos/virtio-scsi.c @@ -0,0 +1,117 @@ +/* + * libqos driver framework + * + * Copyright (c) 2018 Emanuele Giuseppe Esposito + * + * This library is free software; you can redistribute it and/or + * modify

[Qemu-block] [PATCH 30/33] tests/qgraph: virtio-net test node

2018-08-13 Thread Emanuele Giuseppe Esposito
does not allocate any virtio-net structure, it's all done by the qtest walking graph mechanism Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +- tests/virtio-net-test.c | 161 2 files changed, 49 insertions(+), 115 deletions

[Qemu-block] [PATCH 03/33] tests/qgraph: pci-pc driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
Add pci-bus-pc node, move QPCIBusPC struct declaration in its header (since it will be needed by other drivers) and introduce a setter method for drivers that do not need to allocate but have to initialize QPCIBusPC. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 2

[Qemu-block] [PATCH 10/33] tests/qgraph: has_buggy_msi flag

2018-08-13 Thread Emanuele Giuseppe Esposito
The Qgraph framework makes any test using pci bus run the same function using pci-pci and pci-spapr bus. However, some tests are not ready to use the spapr bus, due to a MSI bug. Until it does not get fixed, this flag allows them to skip the test Signed-off-by: Emanuele Giuseppe Esposito

[Qemu-block] [PATCH 08/33] tests/qgraph: pci-spapr driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
Add pci-bus-spapr node, that produces pci-bus. Move QPCIBusSPAPR struct declaration in its header (since it will be needed by other drivers) and introduce a setter method for drivers that do not need to allocate but have to initialize QPCIBusSPAPR. Signed-off-by: Emanuele Giuseppe Esposito

[Qemu-block] [PATCH 04/33] tests/qgraph: x86_64/pc machine node

2018-08-13 Thread Emanuele Giuseppe Esposito
Add pc machine for the x86_64 QEMU binary. This machine contains an i440FX-pcihost driver, that contains itself a pci-bus-pc that produces the pci-bus interface. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 + tests/libqos/x86_64_pc-machine.c | 110

[Qemu-block] [PATCH 00/33] Qtest driver framework

2018-08-13 Thread Emanuele Giuseppe Esposito
ct can be found at: https://wiki.qemu.org/Features/qtest_driver_framework v3: - Minor fixes regarding memory leaks and naming Signed-off-by: Emanuele Giuseppe Esposito Emanuele Giuseppe Esposito (32): tests: qgraph API for the qtest driver framework tests/qgraph: rename qpci_init_pc and qpci_

[Qemu-block] [PATCH 02/33] tests/qgraph: rename qpci_init_pc and qpci_init_spapr functions

2018-08-13 Thread Emanuele Giuseppe Esposito
Rename qpci_init_pc in qpci_pc_new and qpci_init_spapr in qpci_spapr_new, since theese function actually allocate a new pci struct and initialize it. Changed QOSOps field name from qpci_init to qpci_new. Signed-off-by: Emanuele Giuseppe Esposito --- tests/e1000e-test.c | 2 +- tests

[Qemu-block] [PATCH 09/33] tests/qgraph: ppc64/pseries machine node

2018-08-13 Thread Emanuele Giuseppe Esposito
Add pseries machine for the ppc64 QEMU binary. This machine contains a spapr-pci-host-bridge driver, that contains itself a pci-bus-spapr that produces the pci-bus interface. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 1 + tests/libqos/ppc64_pseries

[Qemu-block] [PATCH 17/33] tests: virtio: separate ccw tests from libqos

2018-08-13 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Because qtest does not support s390 channel I/O, s390 only performs smoke tests on those few devices that do not have any functional tests. Therefore, every time we add functional tests for a virtio device, the choice is between removing those tests from the s390 suite (so

[Qemu-block] [PATCH 00/16] qtest: converted sdhci-test and most nop test to qgraph framework

2018-08-20 Thread Emanuele Giuseppe Esposito
-by: Emanuele Giuseppe Esposito Emanuele Giuseppe Esposito (16): test/qgraph: arm/smdkc210 machine node test/qgraph: arm/sabrelite machine node test/qgraph: arm/xlinx-zynq-a9 machine node test/qgraph: aarch64/xlnx-zcu102 machine node test/qgraph: ac97 test node test/qgraph: tpci200 test

[Qemu-block] [PATCH 08/16] test/qgraph: ne2k_pci test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/ne2000-test in qgraph test node, ne2000-test. Since it's a nop test, node creation and initialization is made in the same file. The actual device consumed by the test is ne2k_pci. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/ne2000-test.c

[Qemu-block] [PATCH 15/16] test/qgraph: eepro100 test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/eepro100-test in qgraph test nodes, eepro100-test. Since it's a nop test, node creation and initialization is made in the same file. In addition, all nodes share the same constructor and destructor. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3

[Qemu-block] [PATCH 16/16] test/qgraph: e1000 test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/e1000-test in qgraph test nodes, e1000-test. Since it's a nop test, node creation and initialization is made in the same file. In addition, all nodes share the same constructor and destructor. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests

[Qemu-block] [PATCH 01/16] test/qgraph: arm/smdkc210 machine node

2018-08-20 Thread Emanuele Giuseppe Esposito
Add arm/smdkc210 machine machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 9 ++-- tests/libqos/smdkc210-machine.c | 82

[Qemu-block] [PATCH 06/16] test/qgraph: tpci200 test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/tpci200-test in qgraph test node, tpci200-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 2 +- tests/tpci200-test.c | 60 +++--- 2

[Qemu-block] [PATCH 05/16] test/qgraph: ac97 test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/ac97-test in qgraph test node, ac97-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/ac97-test.c | 39 ++- 2 files

[Qemu-block] [PATCH 11/16] test/qgraph: spapr-phb test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/spapr-phb-test in qgraph test node, spapr-phb-test. This test adds another spapr-pci-host-bridge device in the ppc64/pseries machine Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/spapr-phb-test.c | 28 +++- 2 files

[Qemu-block] [PATCH 13/16] test/qgraph: vmxnet3 test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/vmxnet3-test in qgraph test node, vmxnet3-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/vmxnet3-test.c | 39 ++- 2

[Qemu-block] [PATCH 10/16] test/qgraph: pcnet test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/pcnet-test in qgraph test node, pcnet-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/pcnet-test.c | 39 ++- 2 files

[Qemu-block] [PATCH 14/16] test/qgraph: es1370 test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/es1370-test in qgraph test node, es1370-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/es1370-test.c| 39 ++- 2

[Qemu-block] [PATCH 09/16] test/qgraph: nvme test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/nvme-test in qgraph test node, nvme-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/nvme-test.c | 43 -- 2

[Qemu-block] [PATCH 12/16] test/qgraph: usb-hcd-ohci test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/usb-hcd-ohci-test in qgraph test node, usb-hcd-ohci-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include| 4 +--- tests/usb-hcd-ohci-test.c | 46

[Qemu-block] [PATCH 04/16] test/qgraph: aarch64/xlnx-zcu102 machine node

2018-08-20 Thread Emanuele Giuseppe Esposito
Add xlnx-zcu102 machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 1 + tests/libqos/xlnx-zcu102-machine.c | 83

[Qemu-block] [PATCH 03/16] test/qgraph: arm/xlinx-zynq-a9 machine node

2018-08-20 Thread Emanuele Giuseppe Esposito
Add xlinx-zynq-a9 machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include| 1 + tests/libqos/xilinx-zynq-a9-machine.c | 84

[Qemu-block] [PATCH 07/16] test/qgraph: ipoctal232 test node

2018-08-20 Thread Emanuele Giuseppe Esposito
Convert tests/ipoctal232-test in qgraph test node, ipoctal232-test. Since it's a nop test, node creation and initialization is made in the same file. This test creates a tpci200 node that produces an interface ipack consumed by the ipoctal232 device. Signed-off-by: Emanuele Giuseppe Esposito

Re: [PATCH v5 00/16] qemu_iotests: improve debugging options

2021-06-14 Thread Emanuele Giuseppe Esposito
On 04/06/2021 11:17, Emanuele Giuseppe Esposito wrote: This series adds the option to attach gdbserver and valgrind to the QEMU binary running in qemu_iotests. It also allows to redirect QEMU binaries output of the python tests to the stdout, instead of a log file. Patches 1-9 introduce

Re: [PATCH v5 06/16] qemu-iotests: delay QMP socket timers

2021-06-14 Thread Emanuele Giuseppe Esposito
On 04/06/2021 11:17, Emanuele Giuseppe Esposito wrote: Attaching gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. For Timeout class, create a @contextmanager that switches Timeout with NoTimeout (empty context manager) so that if --gdb is set

Re: [PATCH v5 06/16] qemu-iotests: delay QMP socket timers

2021-06-16 Thread Emanuele Giuseppe Esposito
On 15/06/2021 09:57, Vladimir Sementsov-Ogievskiy wrote: 14.06.2021 13:36, Emanuele Giuseppe Esposito wrote: On 04/06/2021 11:17, Emanuele Giuseppe Esposito wrote: Attaching gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. For Timeout class, create

Re: [PATCH 0/2] block-copy: small fix and refactor

2021-06-07 Thread Emanuele Giuseppe Esposito
On 07/06/2021 17:10, Kevin Wolf wrote: Am 03.06.2021 um 09:38 hat Paolo Bonzini geschrieben: On 02/06/21 14:21, Kevin Wolf wrote: Am 02.06.2021 um 11:13 hat Stefan Hajnoczi geschrieben: On Fri, May 28, 2021 at 05:16:26PM +0300, Vladimir Sementsov-Ogievskiy wrote: Hi all! This is my

Re: [PATCH 0/2] block-copy: small fix and refactor

2021-06-07 Thread Emanuele Giuseppe Esposito
On 07/06/2021 18:18, Vladimir Sementsov-Ogievskiy wrote: 07.06.2021 18:16, Emanuele Giuseppe Esposito wrote: On 07/06/2021 17:10, Kevin Wolf wrote: Am 03.06.2021 um 09:38 hat Paolo Bonzini geschrieben: On 02/06/21 14:21, Kevin Wolf wrote: Am 02.06.2021 um 11:13 hat Stefan Hajnoczi

[PATCH v3 1/5] block-copy: streamline choice of copy_range vs. read/write

2021-06-08 Thread Emanuele Giuseppe Esposito
as an additional copy method. While at it, store the common computation of block_copy_max_transfer into a new field of BlockCopyState, and make sure that we always obey max_transfer; that's more efficient even for the COPY_RANGE_READ_WRITE case. Signed-off-by: Emanuele Giuseppe Esposito Signed-off

[PATCH v3 2/5] block-copy: improve comments of BlockCopyTask and BlockCopyState types and functions

2021-06-08 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 47 ++ 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/block/block-copy.c b/block/block-copy.c index d58051288b..b3533a3003 100644 --- a/block/block-copy.c +++ b/block/block-copy.c

[PATCH v3 5/5] block-copy: atomic .cancelled and .finished fields in BlockCopyCallState

2021-06-08 Thread Emanuele Giuseppe Esposito
By adding acquire/release pairs, we ensure that .ret and .error_is_read fields are written by block_copy_dirty_clusters before .finished is true. The atomic here are necessary because the fields are concurrently modified also outside coroutines. Signed-off-by: Emanuele Giuseppe Esposito

[PATCH v3 4/5] block-copy: add a CoMutex

2021-06-08 Thread Emanuele Giuseppe Esposito
in the following patch, because are used also outside coroutines. Also set block_copy_task_create as coroutine_fn because: 1) it is static and only invoked by coroutine functions 2) this patch introduces and uses a CoMutex lock there Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c

Re: [PATCH v4 1/6] blkdebug: refactor removal of a suspended request

2021-06-08 Thread Emanuele Giuseppe Esposito
On 07/06/2021 11:23, Paolo Bonzini wrote: On 04/06/21 18:16, Eric Blake wrote: On Fri, Jun 04, 2021 at 12:07:36PM +0200, Emanuele Giuseppe Esposito wrote: Extract to a separate function.  Do not rely on FOREACH_SAFE, which is only "safe" if the *current* node is removed---not

[PATCH v3 0/5] block-copy: protect block-copy internal structures

2021-06-08 Thread Emanuele Giuseppe Esposito
952-1-eespo...@redhat.com> Signed-off-by: Emanuele Giuseppe Esposito --- v3: * Use a single lock instead of two [Paolo, Vladimir] * Extend lock to protect also BdrvDirtyBitmap API [Vladimir] * Drop patch 6 (set .method as atomic) since with current refactoring it can be simply included in th

[PATCH v3 3/5] block-copy: move progress_set_remaining in block_copy_task_end

2021-06-08 Thread Emanuele Giuseppe Esposito
Moving this function in task_end ensures to update the progress anyways, even if there is an error. It also helps in next patch, allowing task_end to have only one critical section. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 6

Re: [PATCH v3 2/5] block-copy: improve comments of BlockCopyTask and BlockCopyState types and functions

2021-06-10 Thread Emanuele Giuseppe Esposito
On 10/06/2021 13:12, Vladimir Sementsov-Ogievskiy wrote: 10.06.2021 13:46, Emanuele Giuseppe Esposito wrote: On 10/06/2021 12:27, Vladimir Sementsov-Ogievskiy wrote: 10.06.2021 13:14, Emanuele Giuseppe Esposito wrote: On 09/06/2021 11:12, Vladimir Sementsov-Ogievskiy wrote: 08.06.2021

Re: [PATCH v3 4/5] block-copy: add a CoMutex

2021-06-10 Thread Emanuele Giuseppe Esposito
On 09/06/2021 14:25, Vladimir Sementsov-Ogievskiy wrote: 08.06.2021 10:33, Emanuele Giuseppe Esposito wrote: Add a CoMutex to protect concurrent access of block-copy data structures. This mutex also protects .copy_bitmap, because its thread-safe API does not prevent it from assigning two

Re: [PATCH v3 2/5] block-copy: improve comments of BlockCopyTask and BlockCopyState types and functions

2021-06-10 Thread Emanuele Giuseppe Esposito
On 09/06/2021 11:12, Vladimir Sementsov-Ogievskiy wrote: 08.06.2021 10:33, Emanuele Giuseppe Esposito wrote: As done in BlockCopyCallState, categorize BlockCopyTask and BlockCopyState in IN, State and OUT fields. This is just to understand which field has to be protected with a lock

Re: [PATCH v3 2/5] block-copy: improve comments of BlockCopyTask and BlockCopyState types and functions

2021-06-10 Thread Emanuele Giuseppe Esposito
On 10/06/2021 12:27, Vladimir Sementsov-Ogievskiy wrote: 10.06.2021 13:14, Emanuele Giuseppe Esposito wrote: On 09/06/2021 11:12, Vladimir Sementsov-Ogievskiy wrote: 08.06.2021 10:33, Emanuele Giuseppe Esposito wrote: As done in BlockCopyCallState, categorize BlockCopyTask

[PATCH v6 13/16] qemu-iotests: insert valgrind command line as wrapper for qemu binary

2021-06-21 Thread Emanuele Giuseppe Esposito
If -gdb and -valgrind are both defined, return an error. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu

[PATCH v6 05/16] qemu-iotests: add option to attach gdbserver

2021-06-21 Thread Emanuele Giuseppe Esposito
-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/check | 6 +- tests/qemu-iotests/iotests.py | 5 + tests/qemu-iotests/testenv.py | 17 +++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tests/qemu

[PATCH v6 11/16] qemu-iotests: extend QMP socket timeout when using valgrind

2021-06-21 Thread Emanuele Giuseppe Esposito
As with gdbserver, valgrind delays the test execution, so the default QMP socket timeout and the generic class Timeout in iotests.py timeouts too soon. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 6 +++--- 1 file

[PATCH v6 12/16] qemu-iotests: allow valgrind to read/delete the generated log file

2021-06-21 Thread Emanuele Giuseppe Esposito
When using -valgrind on the script tests, it generates a log file in $TEST_DIR that is either read (if valgrind finds problems) or otherwise deleted. Provide the same exact behavior when using -valgrind on the python tests. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir

[PATCH v6 14/16] docs/devel/testing: add -valgrind option to the debug section of QEMU iotests

2021-06-21 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- docs/devel/testing.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 8b24e6fb47..fa85592a38 100644 --- a/docs/devel

[PATCH v6 02/16] python: Reduce strictness of pylint's duplicate-code check

2021-06-21 Thread Emanuele Giuseppe Esposito
From: John Snow Pylint prior to 2.8.3 (We pin at >= 2.8.0) includes function and method signatures as part of its duplicate checking algorithm. This check does not listen to pragmas, so the only way to disable it is to turn it off completely or increase the minimum duplicate lines so that it

[PATCH v6 01/16] python: qemu: add timer parameter for qmp.accept socket

2021-06-21 Thread Emanuele Giuseppe Esposito
to the QMP monitor test command execution. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- python/qemu/machine/machine.py | 7 +-- python/qemu/machine/qtest.py | 5 +++-- tests/qemu-iotests/iotests.py | 3 ++- 3 files changed, 10 insertions(+), 5

[PATCH v6 10/16] qemu-iotests: extend the check script to prepare supporting valgrind for python tests

2021-06-21 Thread Emanuele Giuseppe Esposito
lgrind PID to assign to the log file name, use the "%p" flag in valgrind log file name that automatically puts the process PID at runtime. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/check | 7

[PATCH v6 09/16] docs/devel/testing: add -gdb option to the debugging section of QEMU iotests

2021-06-21 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- docs/devel/testing.rst | 11 +++ 1 file changed, 11 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 9d6a8f8636..8b24e6fb47 100644 --- a/docs/devel/testing.rst +++ b

[PATCH v6 08/16] qemu-iotests: add gdbserver option to script tests too

2021-06-21 Thread Emanuele Giuseppe Esposito
The only limitation here is that running a script with gdbserver will make the test output mismatch with the expected results, making the test fail. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/common.rc | 8 +++- 1 file changed

[PATCH v6 07/16] qemu_iotests: insert gdbserver command line as wrapper for qemu binary

2021-06-21 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index e176a84620..e7e3d92d3e 100644

[PATCH v6 15/16] qemu-iotests: add option to show qemu binary logs on stdout

2021-06-21 Thread Emanuele Giuseppe Esposito
Using the flag -p, allow the qemu binary to print to stdout. Also create the common function _close_qemu_log_file() to avoid accessing machine.py private fields directly and have duplicate code. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- python

[PATCH v6 06/16] qemu-iotests: delay QMP socket timers

2021-06-21 Thread Emanuele Giuseppe Esposito
Attaching gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests

[PATCH v6 16/16] docs/devel/testing: add -p option to the debug section of QEMU iotests

2021-06-21 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- docs/devel/testing.rst | 4 1 file changed, 4 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index fa85592a38..28a0b37b84 100644 --- a/docs/devel/testing.rst +++ b/docs

[PATCH v6 00/16] qemu_iotests: improve debugging options

2021-06-21 Thread Emanuele Giuseppe Esposito
-off-by: Emanuele Giuseppe Esposito --- v6: * undo the previous series change "base this serie on the double dash options, so define --gdb instead of -gdb" * undo Vladimir's suggestion on patch 5 to use @contextmanager, because it produces a pylint warning. Emanuele Giuseppe Es

[PATCH v6 03/16] python: qemu: pass the wrapper field from QEMUQtestmachine to QEMUMachine

2021-06-21 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Reviewed-by: Max Reitz --- python/qemu/machine/qtest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py

[PATCH v6 04/16] docs/devel/testing: add debug section to the QEMU iotests chapter

2021-06-21 Thread Emanuele Giuseppe Esposito
Introduce the "Debugging a test case" section, in preparation to the additional flags that will be added in the next patches. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy --- docs/devel/testing.rst | 8 1 file changed, 8 insertions(+)

Re: [PATCH v4 6/6] block-copy: atomic .cancelled and .finished fields in BlockCopyCallState

2021-06-22 Thread Emanuele Giuseppe Esposito
On 22/06/2021 12:39, Vladimir Sementsov-Ogievskiy wrote: 22.06.2021 13:20, Paolo Bonzini wrote: On 22/06/21 11:36, Vladimir Sementsov-Ogievskiy wrote: It does.  If it returns true, you still want the load of finished to happen before the reads that follow. Hmm.. The worst case if we use

Re: [PATCH v6 06/16] qemu-iotests: delay QMP socket timers

2021-06-22 Thread Emanuele Giuseppe Esposito
On 22/06/2021 12:50, Vladimir Sementsov-Ogievskiy wrote: 21.06.2021 13:33, Emanuele Giuseppe Esposito wrote: Attaching gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy

Re: [PATCH v4 6/6] block-copy: atomic .cancelled and .finished fields in BlockCopyCallState

2021-06-21 Thread Emanuele Giuseppe Esposito
On 19/06/2021 22:06, Vladimir Sementsov-Ogievskiy wrote: 14.06.2021 10:33, Emanuele Giuseppe Esposito wrote: By adding acquire/release pairs, we ensure that .ret and .error_is_read fields are written by block_copy_dirty_clusters before .finished is true. And that they are read by API user

Re: [PATCH v4 3/6] block-copy: improve comments of BlockCopyTask and BlockCopyState types and functions

2021-06-21 Thread Emanuele Giuseppe Esposito
On 19/06/2021 17:23, Vladimir Sementsov-Ogievskiy wrote: 14.06.2021 10:33, Emanuele Giuseppe Esposito wrote: As done in BlockCopyCallState, categorize BlockCopyTask and BlockCopyState in IN, State and OUT fields. This is just to understand which field has to be protected with a lock

Re: [PATCH v4 3/6] block-copy: improve comments of BlockCopyTask and BlockCopyState types and functions

2021-06-21 Thread Emanuele Giuseppe Esposito
On 19/06/2021 19:27, Vladimir Sementsov-Ogievskiy wrote: 14.06.2021 10:33, Emanuele Giuseppe Esposito wrote: As done in BlockCopyCallState, categorize BlockCopyTask and BlockCopyState in IN, State and OUT fields. This is just to understand which field has to be protected with a lock

Re: [PATCH v4 3/6] block-copy: improve comments of BlockCopyTask and BlockCopyState types and functions

2021-06-21 Thread Emanuele Giuseppe Esposito
On 19/06/2021 20:31, Vladimir Sementsov-Ogievskiy wrote: 19.06.2021 18:23, Vladimir Sementsov-Ogievskiy wrote:   typedef struct BlockCopyTask {   AioTask task; +    /* + * IN parameters. Initialized in block_copy_task_create() + * and never changed. + */ That's just not

Re: [PATCH v4 3/6] block-copy: improve comments of BlockCopyTask and BlockCopyState types and functions

2021-06-21 Thread Emanuele Giuseppe Esposito
On 19/06/2021 20:53, Vladimir Sementsov-Ogievskiy wrote: 14.06.2021 10:33, Emanuele Giuseppe Esposito wrote: --- a/block/block-copy.c +++ b/block/block-copy.c @@ -52,29 +52,35 @@ typedef struct BlockCopyCallState {   /* Coroutine where async block-copy is running */   Coroutine *co

[PATCH v3 2/5] block-copy: let ratelimit handle a speed of 0

2021-06-14 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/block/block-copy.c b/block/block

[PATCH v3 1/5] ratelimit: treat zero speed as unlimited

2021-06-14 Thread Emanuele Giuseppe Esposito
s provided. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/ratelimit.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h index

[PATCH v3 4/5] progressmeter: protect with a mutex

2021-06-14 Thread Emanuele Giuseppe Esposito
to implement the ProgressMeter API, but keep the struct as public, to avoid forcing allocation on the heap. Also add a mutex to be able to provide an accurate snapshot of the progress values to the caller. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- block

[PATCH v3 3/5] blockjob: let ratelimit handle a speed of 0

2021-06-14 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- blockjob.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/blockjob.c b/blockjob.c index dc1d9e0e46..22e5bb9b1f 100644

[PATCH v3 5/5] co-shared-resource: protect with a mutex

2021-06-14 Thread Emanuele Giuseppe Esposito
co-shared-resource is currently not thread-safe, as also reported in co-shared-resource.h. Add a QemuMutex because co_try_get_from_shres can also be invoked from non-coroutine context. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/co

[PATCH v3 0/5] block-copy: make helper APIs thread safe

2021-06-14 Thread Emanuele Giuseppe Esposito
-off-by: Emanuele Giuseppe Esposito --- v3: * Rebase on current master (had conflicts in block-copy), remove based-on in cover letter Emanuele Giuseppe Esposito (2): progressmeter: protect with a mutex co-shared-resource: protect with a mutex Paolo Bonzini (3): ratelimit: treat zero speed

Re: [PATCH v3 0/5] block-copy: make helper APIs thread safe

2021-06-14 Thread Emanuele Giuseppe Esposito
On 14/06/2021 10:11, Emanuele Giuseppe Esposito wrote: This serie of patches bring thread safety to the smaller APIs used by block-copy, namely ratelimit, progressmeter, co-shared-resource and aiotask. The end goal is to reduce the usage of AioContexlock in block-copy, by introducing smaller

[PATCH v3 1/5] ratelimit: treat zero speed as unlimited

2021-06-14 Thread Emanuele Giuseppe Esposito
s provided. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/ratelimit.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h index

[PATCH v3 2/5] block-copy: let ratelimit handle a speed of 0

2021-06-14 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/block/block-copy.c b/block/block

[PATCH v3 0/5] block-copy: make helper APIs thread safe

2021-06-14 Thread Emanuele Giuseppe Esposito
-off-by: Emanuele Giuseppe Esposito --- v3: * Rebase on current master (had conflicts in block-copy), remove based-on in cover letter Emanuele Giuseppe Esposito (2): progressmeter: protect with a mutex co-shared-resource: protect with a mutex Paolo Bonzini (3): ratelimit: treat zero speed

  1   2   3   4   5   6   7   8   9   10   >