[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 15/33] tests/qgraph: virtio-mmio driver and interface nodes

2018-08-13 Thread Emanuele Giuseppe Esposito
nodes. Also 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/libqo

[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 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 chang

[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 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 of

[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 that

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

2018-08-13 Thread Emanuele Giuseppe Esposito
anism 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 28/33] tests/qgraph: virtio-blk test node

2018-08-13 Thread Emanuele Giuseppe Esposito
test 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

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

2018-08-13 Thread Emanuele Giuseppe Esposito
anism 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/

[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
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 inserti

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

2018-08-13 Thread Emanuele Giuseppe Esposito
test 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(-) di

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

2018-08-13 Thread Emanuele Giuseppe Esposito
anism 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 it

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

2018-08-13 Thread Emanuele Giuseppe Esposito
test 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

[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 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 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 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 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 Esp

[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 +++-

[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-t

[Qemu-block] [PATCH 02/16] test/qgraph: arm/sabrelite machine node

2018-08-20 Thread Emanuele Giuseppe Esposito
Add arm/sabrelite 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/sabrelite-machine.c | 82

[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 ++---

[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

[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

[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 ++---

[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

[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

[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

[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 +--

Re: [PATCH v2 0/5] qemu-iotests: quality of life improvements

2021-03-24 Thread Emanuele Giuseppe Esposito
+-- tests/qemu-iotests/testrunner.py | 15 +- 4 files changed, 81 insertions(+), 49 deletions(-) I can confirm that this helps a lot when debugging tests. Tested-by: Emanuele Giuseppe Esposito

[RFC PATCH 1/3] python: qemu: add timer parameter for qmp.accept socket

2021-04-01 Thread Emanuele Giuseppe Esposito
Extend the _post_launch function to include the timer as parameter instead of defaulting to 15 sec. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py | 4 ++-- python/qemu/qtest.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/qemu

[RFC PATCH 0/3] qemu-iotests: attach gdbserver to qemu instance

2021-04-01 Thread Emanuele Giuseppe Esposito
separately. Emanuele Giuseppe Esposito (3): python: qemu: add timer parameter for qmp.accept socket qemu-iotests: add option to attach gdbserver qemu-iotests: add gdbserver option to script tests too python/qemu/machine.py| 8 +--- python/qemu/qtest.py | 8 +--- tests/qe

[RFC PATCH 3/3] qemu-iotests: add gdbserver option to script tests too

2021-04-01 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 --- tests/qemu-iotests/common.rc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff

[RFC PATCH 2/3] qemu-iotests: add option to attach gdbserver

2021-04-01 Thread Emanuele Giuseppe Esposito
ript will ignore the environmental variable. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py| 4 +++- python/qemu/qtest.py | 4 +++- tests/qemu-iotests/check | 5 - tests/qemu-iotests/iotests.py | 7 ++- tests/qemu-iotests/testenv.py | 15

[RFC PATCH v2 00/11] qemu_iotests: improve debugging options

2021-04-07 Thread Emanuele Giuseppe Esposito
series is tested on the previous serie "qemu-iotests: quality of life improvements" but independent from it, so it can be applied separately. Signed-off-by: Emanuele Giuseppe Esposito --- v2: - add valgrind and print patches - better splitup of patches, and clearer commit messages Emanuel

[RFC PATCH v2 01/11] python: qemu: add timer parameter for qmp.accept socket

2021-04-07 Thread Emanuele Giuseppe Esposito
Extend the _post_launch function to include the timer as parameter instead of defaulting to 15 sec. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py | 4 ++-- python/qemu/qtest.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/qemu

[RFC PATCH v2 02/11] python: qemu: pass the wrapper field from QEMUQtestmachine to QEMUMachine

2021-04-07 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py | 2 +- python/qemu/qtest.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index c721e07d63..18d32ebe45 100644 --- a/python/qemu/machine.py +++ b

[RFC PATCH v2 06/11] qemu-iotests: add gdbserver option to script tests too

2021-04-07 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 --- tests/qemu-iotests/common.rc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff

[RFC PATCH v2 08/11] qemu_iotests: extent QMP socket timeout when using valgrind

2021-04-07 Thread Emanuele Giuseppe Esposito
As with gdbserver, valgrind delays the test execution, so the default QMP socket timeout expires too soon. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py| 4 +++- tests/qemu-iotests/iotests.py | 8 2 files changed, 7 insertions(+), 5 deletions(-) diff

[RFC PATCH v2 05/11] qemu_iotests: insert gdbserver command line as wrapper for qemu binary

2021-04-07 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- 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 17f07710db..8f6bb20af5 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu

[RFC PATCH v2 03/11] qemu-iotests: add option to attach gdbserver

2021-04-07 Thread Emanuele Giuseppe Esposito
Add -gdb flag and GDB_QEMU environmental variable to python tests to attach a gdbserver to each qemu instance. if -gdb is not provided but $GDB_QEMU is set, ignore the environmental variable. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/check | 6 +- tests/qemu

[RFC PATCH v2 09/11] qemu_iotests: allow valgrint to print/delete the generated log file

2021-04-07 Thread Emanuele Giuseppe Esposito
When using valgrind on the test scripts, it generates a log file in $TEST_DIR that is either print (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 --- tests/qemu-iotests

[RFC PATCH v2 04/11] qemu-iotests: delay QMP socket timers

2021-04-07 Thread Emanuele Giuseppe Esposito
Attaching a gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py| 4 +++- tests/qemu-iotests/iotests.py | 21 + 2 files changed, 20 insertions(+), 5 deletions

[RFC PATCH v2 11/11] qemu_iotests: add option to show qemu binary logs on stdout

2021-04-07 Thread Emanuele Giuseppe Esposito
Using the flag -p, allow the qemu binary to print to stdout. This is helpful especially for print-debugging. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/check | 3 ++- tests/qemu-iotests/iotests.py | 9 + tests/qemu-iotests/testenv.py | 9 +++-- 3 files

[RFC PATCH v2 10/11] qemu_iotests: insert valgrind command line as wrapper for qemu binary

2021-04-07 Thread Emanuele Giuseppe Esposito
The priority will be given to gdb command line, meaning if -gdb and -valgrind parameters are given, only gdb will be wrapped around the qemu binary. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/iotests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[RFC PATCH v2 07/11] qemu_iotests: extend the check script to support valgrind for python tests

2021-04-07 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 --- tests/qemu-iotests/iotests.py | 11 +++ tests/qemu-iotests/testenv.py | 1 + 2 files ch

Re: [RFC PATCH v2 00/11] qemu_iotests: improve debugging options

2021-04-08 Thread Emanuele Giuseppe Esposito
On 08/04/2021 10:26, Markus Armbruster wrote: Emanuele Giuseppe Esposito writes: 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

Re: [RFC PATCH v2 00/11] qemu_iotests: improve debugging options

2021-04-08 Thread Emanuele Giuseppe Esposito
On 08/04/2021 14:39, Markus Armbruster wrote: Emanuele Giuseppe Esposito writes: On 08/04/2021 10:26, Markus Armbruster wrote: Emanuele Giuseppe Esposito writes: This series adds the option to attach gdbserver and valgrind to the QEMU binary running in qemu_iotests. It also allows to

[PATCH 1/5] blkdebug: refactor removal of a suspended request

2021-04-08 Thread Emanuele Giuseppe Esposito
lo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/blkdebug.c | 28 +--- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 2c0b9b0ee8..8f19d991fa 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -79

[PATCH 2/5] blkdebug: move post-resume handling to resume_req_by_tag

2021-04-08 Thread Emanuele Giuseppe Esposito
handle the yielding. Co-developed-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/blkdebug.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 8f19d991fa..e37f999254 100644 --- a

[PATCH 3/5] blkdebug: track all actions

2021-04-08 Thread Emanuele Giuseppe Esposito
Add a counter for each action that a rule can trigger. This is mainly used to keep track of how many coroutine_yeld() we need to perform after processing all rules in the list. Co-developed-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/blkdebug.c | 17

[PATCH 0/5] blkdebug: fix racing condition when iterating on

2021-04-08 Thread Emanuele Giuseppe Esposito
protect rules and suspended_reqs. Signed-off-by: Emanuele Giuseppe Esposito Emanuele Giuseppe Esposito (5): blkdebug: refactor removal of a suspended request blkdebug: move post-resume handling to resume_req_by_tag blkdebug: track all actions blkdebug: do not suspend in the middle of

[PATCH 4/5] blkdebug: do not suspend in the middle of QLIST_FOREACH_SAFE

2021-04-08 Thread Emanuele Giuseppe Esposito
Use actions_count to see how many yeld to issue. Co-developed-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/blkdebug.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 388b5ed615..dffd869b32 100644 --- a

[PATCH 5/5] blkdebug: protect rules and suspended_reqs with a lock

2021-04-08 Thread Emanuele Giuseppe Esposito
Co-developed-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/blkdebug.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index dffd869b32..e92a35ccbb 100644 --- a/block/blkdebug.c +++ b

Re: [RFC PATCH v2 03/11] qemu-iotests: add option to attach gdbserver

2021-04-08 Thread Emanuele Giuseppe Esposito
On 08/04/2021 17:40, Paolo Bonzini wrote: On 07/04/21 15:50, Emanuele Giuseppe Esposito wrote: +    self.gdb_qemu = os.getenv('GDB_QEMU') + +    if gdb and not self.gdb_qemu: +    self.gdb_qemu = 'localhost:12345' +    elif self.gdb_qemu and not g

Re: [RFC PATCH v2 04/11] qemu-iotests: delay QMP socket timers

2021-04-08 Thread Emanuele Giuseppe Esposito
On 08/04/2021 17:40, Paolo Bonzini wrote: On 07/04/21 15:50, Emanuele Giuseppe Esposito wrote:   def get_qmp_events_filtered(self, wait=60.0):   result = [] -    for ev in self.get_qmp_events(wait=wait): +    qmp_wait = wait +    if qemu_gdb: +    qmp_wait

Re: [RFC PATCH v2 01/11] python: qemu: add timer parameter for qmp.accept socket

2021-04-09 Thread Emanuele Giuseppe Esposito
--- a/python/qemu/qtest.py +++ b/python/qemu/qtest.py @@ -138,9 +138,9 @@ def _pre_launch(self) -> None:   super()._pre_launch()   self._qtest = QEMUQtestProtocol(self._qtest_path, server=True) -    def _post_launch(self) -> None: +    def _post_launch(self, timer) -> None:

Re: [RFC PATCH v2 02/11] python: qemu: pass the wrapper field from QEMUQtestmachine to QEMUMachine

2021-04-09 Thread Emanuele Giuseppe Esposito
diff --git a/python/qemu/machine.py b/python/qemu/machine.py index c721e07d63..18d32ebe45 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -109,7 +109,7 @@ def __init__(self,   self._binary = binary   self._args = list(args) -    self._wrapper = wrapper + 

Re: [RFC PATCH v2 04/11] qemu-iotests: delay QMP socket timers

2021-04-09 Thread Emanuele Giuseppe Esposito
On 08/04/2021 21:03, Paolo Bonzini wrote: Il gio 8 apr 2021, 18:06 Emanuele Giuseppe Esposito <mailto:eespo...@redhat.com>> ha scritto: On 08/04/2021 17:40, Paolo Bonzini wrote: > On 07/04/21 15:50, Emanuele Giuseppe Esposito wrote: >>   def get_q

Re: [PATCH] ratelimit: protect with a mutex

2021-04-14 Thread Emanuele Giuseppe Esposito
uint64_t slice_ns) { +QEMU_LOCK_GUARD(&limit->lock); limit->slice_ns = slice_ns; limit->slice_quota = MAX(((double)speed * slice_ns) / 10ULL, 1); } Reviewed-by: Emanuele Giuseppe Esposito

[PATCH v3 00/15] qemu_iotests: improve debugging options

2021-04-14 Thread Emanuele Giuseppe Esposito
series is tested on the previous serie "qemu-iotests: quality of life improvements" but independent from it, so it can be applied separately. Signed-off-by: Emanuele Giuseppe Esposito --- v3: - Introduce the class field _qmp_timer instead of a function parameter in the _post_launch() func

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

2021-04-14 Thread Emanuele Giuseppe Esposito
Add a new _qmp_timer field to the QEMUMachine class. The default timer is 15 sec, as per the default in the qmp accept() function. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/qemu/machine.py b

[PATCH v3 04/15] qemu-iotests: add option to attach gdbserver

2021-04-14 Thread Emanuele Giuseppe Esposito
Add -gdb flag and GDB_QEMU environmental variable to python tests to attach a gdbserver to each qemu instance. if -gdb is not provided but $GDB_QEMU is set, ignore the environmental variable. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/check | 6 +- tests/qemu

[PATCH v3 02/15] python: qemu: pass the wrapper field from QEMUQtestmachine to QEMUMachine

2021-04-14 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/qtest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/qemu/qtest.py b/python/qemu/qtest.py index 39a0cf62fe..c18eae96c6 100644 --- a/python/qemu/qtest.py +++ b/python/qemu/qtest.py @@ -111,6 +111,7

[PATCH v3 06/15] qemu_iotests: insert gdbserver command line as wrapper for qemu binary

2021-04-14 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- 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 380527245e..4f3fb13915 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu

[PATCH v3 03/15] docs/devel/testing: add debug section to the QEMU iotests chapter

2021-04-14 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 --- docs/devel/testing.rst | 8 1 file changed, 8 insertions(+) diff --git a/docs/devel/testing.rst b/

[PATCH v3 07/15] qemu-iotests: add gdbserver option to script tests too

2021-04-14 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 --- tests/qemu-iotests/common.rc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff

[PATCH v3 12/15] qemu_iotests: insert valgrind command line as wrapper for qemu binary

2021-04-14 Thread Emanuele Giuseppe Esposito
The priority will be given to gdb command line, meaning if the -gdb parameter and -valgrind are given, gdb will be wrapped around the qemu binary. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/iotests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

[PATCH v3 08/15] docs/devel/testing: add -gdb option to the debugging section of QEMU iotests

2021-04-14 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- docs/devel/testing.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index b7e2370e7e..2ee77a057b 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -229,6 +229,13

[PATCH v3 09/15] qemu_iotests: extend the check script to support valgrind for python tests

2021-04-14 Thread Emanuele Giuseppe Esposito
ing 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 --- tests/qemu-iotests/check | 7 --- tests/qemu-iotests/iotests.py | 11 +++ tests/qemu-iot

[PATCH v3 11/15] qemu_iotests: allow valgrind to read/delete the generated log file

2021-04-14 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 --- tests/qemu-iotests

[PATCH v3 05/15] qemu-iotests: delay QMP socket timers

2021-04-14 Thread Emanuele Giuseppe Esposito
Attaching a gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py| 3 +++ tests/qemu-iotests/iotests.py | 10 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a

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

2021-04-14 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- docs/devel/testing.rst | 4 1 file changed, 4 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 62902cfd2d..0c18fc4571 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -246,6 +246,10 @@ given as

[PATCH v3 14/15] qemu_iotests: add option to show qemu binary logs on stdout

2021-04-14 Thread Emanuele Giuseppe Esposito
Using the flag -p, allow the qemu binary to print to stdout. This helps especially when doing print-debugging. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/check | 3 ++- tests/qemu-iotests/iotests.py | 9 + tests/qemu-iotests/testenv.py | 9 +++-- 3 files

[PATCH v3 10/15] qemu_iotests: extent QMP socket timeout when using valgrind

2021-04-14 Thread Emanuele Giuseppe Esposito
As with gdbserver, valgrind delays the test execution, so the default QMP socket timeout timeout too soon. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py| 2 +- tests/qemu-iotests/iotests.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH v3 13/15] docs/devel/testing: add -valgrind option to the debug section of QEMU iotests

2021-04-14 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- docs/devel/testing.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 2ee77a057b..62902cfd2d 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -236,6 +236,13 @@ given

[PATCH v2 0/8] Block layer thread-safety, continued

2021-04-19 Thread Emanuele Giuseppe Esposito
https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg01398.html Signed-off-by: Emanuele Giuseppe Esposito --- v1 (2017) -> v2 (2021): - v1 Patch "block-backup: add reqs_lock" has been dropped, because now is completely different from the old version and all functions that were affect

[PATCH v2 1/8] block: prepare write threshold code for thread safety

2021-04-19 Thread Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi Co-developed-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/write-threshold.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/block/write-threshold.c b/block/write-threshold.c index

[PATCH v2 2/8] block: protect write threshold QMP commands from concurrent requests

2021-04-19 Thread Emanuele Giuseppe Esposito
For simplicity, use bdrv_drained_begin/end to avoid concurrent writes to the write threshold, or reading it while it is being set. qmp_block_set_write_threshold is protected by the BQL. Reviewed-by: Stefan Hajnoczi Co-developed-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito

[PATCH v2 4/8] block: make before-write notifiers thread-safe

2021-04-19 Thread Emanuele Giuseppe Esposito
Reads access the list in RCU style, so be careful to avoid use-after-free scenarios in the backup block job. Apart from this, all that's needed is protecting updates with a mutex. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- bl

[PATCH v2 3/8] util: use RCU accessors for notifiers

2021-04-19 Thread Emanuele Giuseppe Esposito
aders complete, no matter how "readers" are defined. In the next patch, for example, synchronize_rcu's role is taken by bdrv_drain (which is a superset of synchronize_rcu, since it also blocks new incoming readers). Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Signed-off-b

[PATCH v2 5/8] block: add a few more notes on locking

2021-04-19 Thread Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- include/block/block_int.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index a1aad5ad2d..67a0777e12 100644

[PATCH v2 8/8] block: do not take AioContext around reopen

2021-04-19 Thread Emanuele Giuseppe Esposito
Reopen needs to handle AioContext carefully due to calling bdrv_drain_all_begin/end. By not taking AioContext around calls to bdrv_reopen_multiple, we can drop the function's release/acquire pair and the AioContext argument too. Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giu

[PATCH v2 7/8] block/replication: do not acquire AioContext

2021-04-19 Thread Emanuele Giuseppe Esposito
Replication functions are mostly called when the BDS is quiescent and does not have any pending I/O. They do not need to synchronize on anything since BDS and BB are now thread-safe. Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/replication.c | 54

[PATCH v2 6/8] block: do not acquire AioContext in check_to_replace_node

2021-04-19 Thread Emanuele Giuseppe Esposito
Make the (only) caller do it. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 22 +- blockdev.c| 7 ++- include/block/block.h | 1 + 3 files changed, 12 insertions(+), 18

[RFC PATCH 0/3] block-copy: lock tasks and calls list

2021-04-20 Thread Emanuele Giuseppe Esposito
This serie of patches continues Paolo's series on making the block layer thread safe. Add a CoMutex lock for both tasks and calls list present in block/block-copy.c Signed-off-by: Emanuele Giuseppe Esposito Emanuele Giuseppe Esposito (3): block-copy: improve documentation for BlockCop

[RFC PATCH 1/3] block-copy: improve documentation for BlockCopyTask type and functions

2021-04-20 Thread Emanuele Giuseppe Esposito
. Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/block/block-copy.c b/block/block-copy.c index 39ae481c8b..03df50a354 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -48,25 +48,32

[RFC PATCH 2/3] block-copy: add a CoMutex to the BlockCopyTask list

2021-04-20 Thread Emanuele Giuseppe Esposito
Because the list of tasks is only modified by coroutine functions, add a CoMutex in order to protect the list of tasks. Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/block/block

[RFC PATCH 3/3] block-copy: add CoMutex lock for BlockCopyCallState list

2021-04-20 Thread Emanuele Giuseppe Esposito
Use the same tasks_lock, since the calls list is just used for debug purposes. Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/block/block-copy.c b/block/block-copy.c index e785ac57e0..555f5fb747 100644

Re: [RFC PATCH 1/3] block-copy: improve documentation for BlockCopyTask type and functions

2021-04-20 Thread Emanuele Giuseppe Esposito
On 20/04/2021 14:03, Vladimir Sementsov-Ogievskiy wrote: 20.04.2021 13:04, Emanuele Giuseppe Esposito wrote: As done in BlockCopyCallState, categorize BlockCopyTask in IN, State and OUT fields. This is just to understand which field has to be protected with a lock. Also add coroutine_fn

Re: [PATCH] block: simplify write-threshold and drop write notifiers

2021-04-22 Thread Emanuele Giuseppe Esposito
On 22/04/2021 00:09, Vladimir Sementsov-Ogievskiy wrote: write-notifiers are used only for write-threshold. New code for such purpose should create filters. Let's handle write-threshold simply in generic code and drop write notifiers at all. Also move part of write-threshold API that is used

Re: [PATCH v3 05/15] qemu-iotests: delay QMP socket timers

2021-04-30 Thread Emanuele Giuseppe Esposito
On 30/04/2021 13:59, Max Reitz wrote: On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Attaching a gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. Signed-off-by: Emanuele Giuseppe Esposito ---   python/qemu/machine.py    |  3 +++   tests/qemu

Re: [PATCH v3 04/15] qemu-iotests: add option to attach gdbserver

2021-04-30 Thread Emanuele Giuseppe Esposito
On 30/04/2021 13:38, Max Reitz wrote: On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Add -gdb flag and GDB_QEMU environmental variable to python tests to attach a gdbserver to each qemu instance. Well, this patch doesn’t do this, but OK. Maybe "define" rather than &qu

<    1   2   3   4   5   6   7   8   9   10   >