[PULL 00/12] Block patches

Test FreeBSD passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200624100210.59975-1-stefanha@redhat.com
There is a newer version of this series
configure                    |  73 ++++++++++++
include/qemu/coroutine_int.h |   5 +
block/nvme.c                 | 220 +++++++++++++++++++++++++----------
util/coroutine-sigaltstack.c |   4 +
util/coroutine-ucontext.c    |  28 +++++
block/trace-events           |   2 +-
scripts/minikconf.py         |   6 +-
tests/check-block.sh         |  12 +-
8 files changed, 284 insertions(+), 66 deletions(-)
[PULL 00/12] Block patches
Posted by Stefan Hajnoczi 3 years, 10 months ago
The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:

  Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)

are available in the Git repository at:

  https://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:

  block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Daniele Buono (4):
  coroutine: support SafeStack in ucontext backend
  coroutine: add check for SafeStack in sigaltstack
  configure: add flags to support SafeStack
  check-block: enable iotests with SafeStack

Stefan Hajnoczi (8):
  minikconf: explicitly set encoding to UTF-8
  block/nvme: poll queues without q->lock
  block/nvme: drop tautologous assertion
  block/nvme: don't access CQE after moving cq.head
  block/nvme: switch to a NVMeRequest freelist
  block/nvme: clarify that free_req_queue is protected by q->lock
  block/nvme: keep BDRVNVMeState pointer in NVMeQueuePair
  block/nvme: support nested aio_poll()

 configure                    |  73 ++++++++++++
 include/qemu/coroutine_int.h |   5 +
 block/nvme.c                 | 220 +++++++++++++++++++++++++----------
 util/coroutine-sigaltstack.c |   4 +
 util/coroutine-ucontext.c    |  28 +++++
 block/trace-events           |   2 +-
 scripts/minikconf.py         |   6 +-
 tests/check-block.sh         |  12 +-
 8 files changed, 284 insertions(+), 66 deletions(-)

-- 
2.26.2

Re: [PULL 00/12] Block patches
Posted by Peter Maydell 3 years, 10 months ago
On Wed, 24 Jun 2020 at 11:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:
>
>   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:
>
>   block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)
>
> ----------------------------------------------------------------
> Pull request
>
> ----------------------------------------------------------------

Failure on iotest 030, x86-64 Linux:

  TEST    iotest-qcow2: 030 [fail]
QEMU          --
"/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64"
-nodefaults -display none -accel qtest
QEMU_IMG      --
"/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-img"
QEMU_IO       --
"/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-io"
 --cache writeback --aio threads -f qcow2
QEMU_NBD      --
"/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-nbd"
IMGFMT        -- qcow2 (compat=1.1)
IMGPROTO      -- file
PLATFORM      -- Linux/x86_64 e104462 4.15.0-76-generic
TEST_DIR      --
/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/scratch
SOCK_DIR      -- /tmp/tmp.8tgdDjoZcO
SOCKET_SCM_HELPER --
/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotest/socket_scm_helper

--- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/030.out
 2019-07-15 17:18:35.251364738 +0100
+++ /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/030.out.bad
  2020-06-25 14:04:28.500534007 +0100
@@ -1,5 +1,17 @@
-...........................
+.............F.............
+======================================================================
+FAIL: test_stream_parallel (__main__.TestParallelOps)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "030", line 246, in test_stream_parallel
+    self.assert_qmp(result, 'return', {})
+  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
line 848, in assert_qmp
+    result = self.dictpath(d, path)
+  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
line 822, in dictpath
+    self.fail(f'failed path traversal for "{path}" in "{d}"')
+AssertionError: failed path traversal for "return" in "{'error':
{'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not
found"}}"
+
 ----------------------------------------------------------------------
 Ran 27 tests

-OK
+FAILED (failures=1)


thanks
-- PMM

Re: [PULL 00/12] Block patches
Posted by Stefan Hajnoczi 3 years, 10 months ago
On Thu, Jun 25, 2020 at 02:31:14PM +0100, Peter Maydell wrote:
> On Wed, 24 Jun 2020 at 11:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> >
> > The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:
> >
> >   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)
> >
> > are available in the Git repository at:
> >
> >   https://github.com/stefanha/qemu.git tags/block-pull-request
> >
> > for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:
> >
> >   block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)
> >
> > ----------------------------------------------------------------
> > Pull request
> >
> > ----------------------------------------------------------------
> 
> Failure on iotest 030, x86-64 Linux:
> 
>   TEST    iotest-qcow2: 030 [fail]
> QEMU          --
> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64"
> -nodefaults -display none -accel qtest
> QEMU_IMG      --
> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-img"
> QEMU_IO       --
> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-io"
>  --cache writeback --aio threads -f qcow2
> QEMU_NBD      --
> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-nbd"
> IMGFMT        -- qcow2 (compat=1.1)
> IMGPROTO      -- file
> PLATFORM      -- Linux/x86_64 e104462 4.15.0-76-generic
> TEST_DIR      --
> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/scratch
> SOCK_DIR      -- /tmp/tmp.8tgdDjoZcO
> SOCKET_SCM_HELPER --
> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotest/socket_scm_helper
> 
> --- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/030.out
>  2019-07-15 17:18:35.251364738 +0100
> +++ /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/030.out.bad
>   2020-06-25 14:04:28.500534007 +0100
> @@ -1,5 +1,17 @@
> -...........................
> +.............F.............
> +======================================================================
> +FAIL: test_stream_parallel (__main__.TestParallelOps)
> +----------------------------------------------------------------------
> +Traceback (most recent call last):
> +  File "030", line 246, in test_stream_parallel
> +    self.assert_qmp(result, 'return', {})
> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> line 848, in assert_qmp
> +    result = self.dictpath(d, path)
> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> line 822, in dictpath
> +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> +AssertionError: failed path traversal for "return" in "{'error':
> {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not
> found"}}"
> +
>  ----------------------------------------------------------------------
>  Ran 27 tests
> 
> -OK
> +FAILED (failures=1)

Strange, I can't reproduce this failure on my pull request branch or on
qemu.git/master.

Is this failure deterministic? Are you sure it is introduced by this
pull request?

Stefan
Re: [PULL 00/12] Block patches
Posted by Philippe Mathieu-Daudé 3 years, 9 months ago
On 6/26/20 12:25 PM, Stefan Hajnoczi wrote:
> On Thu, Jun 25, 2020 at 02:31:14PM +0100, Peter Maydell wrote:
>> On Wed, 24 Jun 2020 at 11:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>>>
>>> The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:
>>>
>>>   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)
>>>
>>> are available in the Git repository at:
>>>
>>>   https://github.com/stefanha/qemu.git tags/block-pull-request
>>>
>>> for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:
>>>
>>>   block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)
>>>
>>> ----------------------------------------------------------------
>>> Pull request
>>>
>>> ----------------------------------------------------------------
>>
>> Failure on iotest 030, x86-64 Linux:
>>
>>   TEST    iotest-qcow2: 030 [fail]
>> QEMU          --
>> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64"
>> -nodefaults -display none -accel qtest
>> QEMU_IMG      --
>> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-img"
>> QEMU_IO       --
>> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-io"
>>  --cache writeback --aio threads -f qcow2
>> QEMU_NBD      --
>> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-nbd"
>> IMGFMT        -- qcow2 (compat=1.1)
>> IMGPROTO      -- file
>> PLATFORM      -- Linux/x86_64 e104462 4.15.0-76-generic
>> TEST_DIR      --
>> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/scratch
>> SOCK_DIR      -- /tmp/tmp.8tgdDjoZcO
>> SOCKET_SCM_HELPER --
>> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotest/socket_scm_helper
>>
>> --- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/030.out
>>  2019-07-15 17:18:35.251364738 +0100
>> +++ /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/030.out.bad
>>   2020-06-25 14:04:28.500534007 +0100
>> @@ -1,5 +1,17 @@
>> -...........................
>> +.............F.............
>> +======================================================================
>> +FAIL: test_stream_parallel (__main__.TestParallelOps)
>> +----------------------------------------------------------------------
>> +Traceback (most recent call last):
>> +  File "030", line 246, in test_stream_parallel
>> +    self.assert_qmp(result, 'return', {})
>> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
>> line 848, in assert_qmp
>> +    result = self.dictpath(d, path)
>> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
>> line 822, in dictpath
>> +    self.fail(f'failed path traversal for "{path}" in "{d}"')
>> +AssertionError: failed path traversal for "return" in "{'error':
>> {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not
>> found"}}"
>> +
>>  ----------------------------------------------------------------------
>>  Ran 27 tests
>>
>> -OK
>> +FAILED (failures=1)
> 
> Strange, I can't reproduce this failure on my pull request branch or on
> qemu.git/master.
> 
> Is this failure deterministic? Are you sure it is introduced by this
> pull request?

Probably not introduced by this pullreq, but I also hit it on FreeBSD:
https://cirrus-ci.com/task/4620718312783872?command=main#L5803

  TEST    iotest-qcow2: 030 [fail]
QEMU          --
"/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../aarch64-softmmu/qemu-system-aarch64"
-nodefaults -display none -machine virt -accel qtest
QEMU_IMG      --
"/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-img"
QEMU_IO       --
"/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-io"  --cache
writeback --aio threads -f qcow2
QEMU_NBD      --
"/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-nbd"
IMGFMT        -- qcow2 (compat=1.1)
IMGPROTO      -- file
PLATFORM      -- FreeBSD/amd64 cirrus-task-4620718312783872 12.1-RELEASE
TEST_DIR      -- /tmp/cirrus-ci-build/build/tests/qemu-iotests/scratch
SOCK_DIR      -- /tmp/tmp.aZ5pxFLF
SOCKET_SCM_HELPER --
--- /tmp/cirrus-ci-build/tests/qemu-iotests/030.out	2020-07-07
14:48:48.123804000 +0000
+++ /tmp/cirrus-ci-build/build/tests/qemu-iotests/030.out.bad	2020-07-07
15:05:07.863685000 +0000
@@ -1,5 +1,17 @@
-...........................
+.............F.............
+======================================================================
+FAIL: test_stream_parallel (__main__.TestParallelOps)
 ----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "030", line 246, in test_stream_parallel
+    self.assert_qmp(result, 'return', {})
+  File "/tmp/cirrus-ci-build/tests/qemu-iotests/iotests.py", line 848,
in assert_qmp
+    result = self.dictpath(d, path)
+  File "/tmp/cirrus-ci-build/tests/qemu-iotests/iotests.py", line 822,
in dictpath
+    self.fail(f'failed path traversal for "{path}" in "{d}"')
+AssertionError: failed path traversal for "return" in "{'error':
{'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not found"}}"
+
+----------------------------------------------------------------------
 Ran 27 tests

-OK
+FAILED (failures=1)
Failed 1 of 74 iotests
gmake: *** [/tmp/cirrus-ci-build/tests/Makefile.include:880:
check-tests/check-block.sh] Error 1
Exit status: 2


Re: [PULL 00/12] Block patches
Posted by Eduardo Habkost 3 years, 9 months ago
On Tue, Jul 07, 2020 at 05:28:21PM +0200, Philippe Mathieu-Daudé wrote:
> On 6/26/20 12:25 PM, Stefan Hajnoczi wrote:
> > On Thu, Jun 25, 2020 at 02:31:14PM +0100, Peter Maydell wrote:
> >> On Wed, 24 Jun 2020 at 11:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> >>>
> >>> The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:
> >>>
> >>>   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)
> >>>
> >>> are available in the Git repository at:
> >>>
> >>>   https://github.com/stefanha/qemu.git tags/block-pull-request
> >>>
> >>> for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:
> >>>
> >>>   block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)
> >>>
> >>> ----------------------------------------------------------------
> >>> Pull request
> >>>
> >>> ----------------------------------------------------------------
> >>
> >> Failure on iotest 030, x86-64 Linux:
> >>
> >>   TEST    iotest-qcow2: 030 [fail]
> >> QEMU          --
> >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64"
> >> -nodefaults -display none -accel qtest
> >> QEMU_IMG      --
> >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-img"
> >> QEMU_IO       --
> >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-io"
> >>  --cache writeback --aio threads -f qcow2
> >> QEMU_NBD      --
> >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-nbd"
> >> IMGFMT        -- qcow2 (compat=1.1)
> >> IMGPROTO      -- file
> >> PLATFORM      -- Linux/x86_64 e104462 4.15.0-76-generic
> >> TEST_DIR      --
> >> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/scratch
> >> SOCK_DIR      -- /tmp/tmp.8tgdDjoZcO
> >> SOCKET_SCM_HELPER --
> >> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotest/socket_scm_helper
> >>
> >> --- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/030.out
> >>  2019-07-15 17:18:35.251364738 +0100
> >> +++ /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/030.out.bad
> >>   2020-06-25 14:04:28.500534007 +0100
> >> @@ -1,5 +1,17 @@
> >> -...........................
> >> +.............F.............
> >> +======================================================================
> >> +FAIL: test_stream_parallel (__main__.TestParallelOps)
> >> +----------------------------------------------------------------------
> >> +Traceback (most recent call last):
> >> +  File "030", line 246, in test_stream_parallel
> >> +    self.assert_qmp(result, 'return', {})
> >> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> >> line 848, in assert_qmp
> >> +    result = self.dictpath(d, path)
> >> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> >> line 822, in dictpath
> >> +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> >> +AssertionError: failed path traversal for "return" in "{'error':
> >> {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not
> >> found"}}"
> >> +
> >>  ----------------------------------------------------------------------
> >>  Ran 27 tests
> >>
> >> -OK
> >> +FAILED (failures=1)
> > 
> > Strange, I can't reproduce this failure on my pull request branch or on
> > qemu.git/master.
> > 
> > Is this failure deterministic? Are you sure it is introduced by this
> > pull request?
> 
> Probably not introduced by this pullreq, but I also hit it on FreeBSD:
> https://cirrus-ci.com/task/4620718312783872?command=main#L5803
> 
>   TEST    iotest-qcow2: 030 [fail]
> QEMU          --
> "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../aarch64-softmmu/qemu-system-aarch64"
> -nodefaults -display none -machine virt -accel qtest
> QEMU_IMG      --
> "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-img"
> QEMU_IO       --
> "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-io"  --cache
> writeback --aio threads -f qcow2
> QEMU_NBD      --
> "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-nbd"
> IMGFMT        -- qcow2 (compat=1.1)
> IMGPROTO      -- file
> PLATFORM      -- FreeBSD/amd64 cirrus-task-4620718312783872 12.1-RELEASE
> TEST_DIR      -- /tmp/cirrus-ci-build/build/tests/qemu-iotests/scratch
> SOCK_DIR      -- /tmp/tmp.aZ5pxFLF
> SOCKET_SCM_HELPER --
> --- /tmp/cirrus-ci-build/tests/qemu-iotests/030.out	2020-07-07
> 14:48:48.123804000 +0000
> +++ /tmp/cirrus-ci-build/build/tests/qemu-iotests/030.out.bad	2020-07-07
> 15:05:07.863685000 +0000
> @@ -1,5 +1,17 @@
> -...........................
> +.............F.............
> +======================================================================
> +FAIL: test_stream_parallel (__main__.TestParallelOps)
>  ----------------------------------------------------------------------
> +Traceback (most recent call last):
> +  File "030", line 246, in test_stream_parallel
> +    self.assert_qmp(result, 'return', {})
> +  File "/tmp/cirrus-ci-build/tests/qemu-iotests/iotests.py", line 848,
> in assert_qmp
> +    result = self.dictpath(d, path)
> +  File "/tmp/cirrus-ci-build/tests/qemu-iotests/iotests.py", line 822,
> in dictpath
> +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> +AssertionError: failed path traversal for "return" in "{'error':
> {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not found"}}"
> +
> +----------------------------------------------------------------------
>  Ran 27 tests

Looks like a race condition that can be forced with a sleep call.
With the following patch, I can reproduce it every time:

  diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
  index 1cdd7e2999..ee5374fc22 100755
  --- a/tests/qemu-iotests/030
  +++ b/tests/qemu-iotests/030
  @@ -241,6 +241,7 @@ class TestParallelOps(iotests.QMPTestCase):
               result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
               self.assert_qmp(result, 'return', {})
  
  +        time.sleep(3)
           for job in pending_jobs:
               result = self.vm.qmp('block-job-set-speed', device=job, speed=0)
               self.assert_qmp(result, 'return', {})
  

-- 
Eduardo


Re: [PULL 00/12] Block patches
Posted by Kevin Wolf 3 years, 9 months ago
Am 08.07.2020 um 00:05 hat Eduardo Habkost geschrieben:
> On Tue, Jul 07, 2020 at 05:28:21PM +0200, Philippe Mathieu-Daudé wrote:
> > On 6/26/20 12:25 PM, Stefan Hajnoczi wrote:
> > > On Thu, Jun 25, 2020 at 02:31:14PM +0100, Peter Maydell wrote:
> > >> On Wed, 24 Jun 2020 at 11:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > >>>
> > >>> The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:
> > >>>
> > >>>   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)
> > >>>
> > >>> are available in the Git repository at:
> > >>>
> > >>>   https://github.com/stefanha/qemu.git tags/block-pull-request
> > >>>
> > >>> for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:
> > >>>
> > >>>   block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)
> > >>>
> > >>> ----------------------------------------------------------------
> > >>> Pull request
> > >>>
> > >>> ----------------------------------------------------------------
> > >>
> > >> Failure on iotest 030, x86-64 Linux:
> > >>
> > >>   TEST    iotest-qcow2: 030 [fail]
> > >> QEMU          --
> > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64"
> > >> -nodefaults -display none -accel qtest
> > >> QEMU_IMG      --
> > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-img"
> > >> QEMU_IO       --
> > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-io"
> > >>  --cache writeback --aio threads -f qcow2
> > >> QEMU_NBD      --
> > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-nbd"
> > >> IMGFMT        -- qcow2 (compat=1.1)
> > >> IMGPROTO      -- file
> > >> PLATFORM      -- Linux/x86_64 e104462 4.15.0-76-generic
> > >> TEST_DIR      --
> > >> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/scratch
> > >> SOCK_DIR      -- /tmp/tmp.8tgdDjoZcO
> > >> SOCKET_SCM_HELPER --
> > >> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotest/socket_scm_helper
> > >>
> > >> --- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/030.out
> > >>  2019-07-15 17:18:35.251364738 +0100
> > >> +++ /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/030.out.bad
> > >>   2020-06-25 14:04:28.500534007 +0100
> > >> @@ -1,5 +1,17 @@
> > >> -...........................
> > >> +.............F.............
> > >> +======================================================================
> > >> +FAIL: test_stream_parallel (__main__.TestParallelOps)
> > >> +----------------------------------------------------------------------
> > >> +Traceback (most recent call last):
> > >> +  File "030", line 246, in test_stream_parallel
> > >> +    self.assert_qmp(result, 'return', {})
> > >> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > >> line 848, in assert_qmp
> > >> +    result = self.dictpath(d, path)
> > >> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > >> line 822, in dictpath
> > >> +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> > >> +AssertionError: failed path traversal for "return" in "{'error':
> > >> {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not
> > >> found"}}"
> > >> +
> > >>  ----------------------------------------------------------------------
> > >>  Ran 27 tests
> > >>
> > >> -OK
> > >> +FAILED (failures=1)
> > > 
> > > Strange, I can't reproduce this failure on my pull request branch or on
> > > qemu.git/master.
> > > 
> > > Is this failure deterministic? Are you sure it is introduced by this
> > > pull request?
> > 
> > Probably not introduced by this pullreq, but I also hit it on FreeBSD:
> > https://cirrus-ci.com/task/4620718312783872?command=main#L5803
> > 
> >   TEST    iotest-qcow2: 030 [fail]
> > QEMU          --
> > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../aarch64-softmmu/qemu-system-aarch64"
> > -nodefaults -display none -machine virt -accel qtest
> > QEMU_IMG      --
> > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-img"
> > QEMU_IO       --
> > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-io"  --cache
> > writeback --aio threads -f qcow2
> > QEMU_NBD      --
> > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-nbd"
> > IMGFMT        -- qcow2 (compat=1.1)
> > IMGPROTO      -- file
> > PLATFORM      -- FreeBSD/amd64 cirrus-task-4620718312783872 12.1-RELEASE
> > TEST_DIR      -- /tmp/cirrus-ci-build/build/tests/qemu-iotests/scratch
> > SOCK_DIR      -- /tmp/tmp.aZ5pxFLF
> > SOCKET_SCM_HELPER --
> > --- /tmp/cirrus-ci-build/tests/qemu-iotests/030.out	2020-07-07
> > 14:48:48.123804000 +0000
> > +++ /tmp/cirrus-ci-build/build/tests/qemu-iotests/030.out.bad	2020-07-07
> > 15:05:07.863685000 +0000
> > @@ -1,5 +1,17 @@
> > -...........................
> > +.............F.............
> > +======================================================================
> > +FAIL: test_stream_parallel (__main__.TestParallelOps)
> >  ----------------------------------------------------------------------
> > +Traceback (most recent call last):
> > +  File "030", line 246, in test_stream_parallel
> > +    self.assert_qmp(result, 'return', {})
> > +  File "/tmp/cirrus-ci-build/tests/qemu-iotests/iotests.py", line 848,
> > in assert_qmp
> > +    result = self.dictpath(d, path)
> > +  File "/tmp/cirrus-ci-build/tests/qemu-iotests/iotests.py", line 822,
> > in dictpath
> > +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> > +AssertionError: failed path traversal for "return" in "{'error':
> > {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not found"}}"
> > +
> > +----------------------------------------------------------------------
> >  Ran 27 tests
> 
> Looks like a race condition that can be forced with a sleep call.
> With the following patch, I can reproduce it every time:
> 
>   diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
>   index 1cdd7e2999..ee5374fc22 100755
>   --- a/tests/qemu-iotests/030
>   +++ b/tests/qemu-iotests/030
>   @@ -241,6 +241,7 @@ class TestParallelOps(iotests.QMPTestCase):
>                result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
>                self.assert_qmp(result, 'return', {})
>   
>   +        time.sleep(3)
>            for job in pending_jobs:
>                result = self.vm.qmp('block-job-set-speed', device=job, speed=0)
>                self.assert_qmp(result, 'return', {})

We can "fix" it for probably all realistic cases by lowering the speed
of the block job significantly. It's still not fully fixed for all
theoretical cases, but the pattern of starting a block job that is
throttled to a low speed so it will keep running for the next part of
the test is very common.

Kevin

diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 256b2bfbc6..31c028306b 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -243,7 +243,7 @@ class TestParallelOps(iotests.QMPTestCase):
             node_name = 'node%d' % i
             job_id = 'stream-%s' % node_name
             pending_jobs.append(job_id)
-            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
+            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=1024)
             self.assert_qmp(result, 'return', {})

         for job in pending_jobs:


Re: [PULL 00/12] Block patches
Posted by Peter Maydell 3 years, 9 months ago
On Thu, 9 Jul 2020 at 16:02, Kevin Wolf <kwolf@redhat.com> wrote:
>
> We can "fix" it for probably all realistic cases by lowering the speed
> of the block job significantly. It's still not fully fixed for all
> theoretical cases, but the pattern of starting a block job that is
> throttled to a low speed so it will keep running for the next part of
> the test is very common.
>
> Kevin
>
> diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> index 256b2bfbc6..31c028306b 100755
> --- a/tests/qemu-iotests/030
> +++ b/tests/qemu-iotests/030
> @@ -243,7 +243,7 @@ class TestParallelOps(iotests.QMPTestCase):
>              node_name = 'node%d' % i
>              job_id = 'stream-%s' % node_name
>              pending_jobs.append(job_id)
> -            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
> +            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=1024)
>              self.assert_qmp(result, 'return', {})
>
>          for job in pending_jobs:

Any chance we could get this fix into the tree? I've just
had an unrelated mergebuild test run hit this iotest 030
failure again...

-- PMM

Re: [PULL 00/12] Block patches
Posted by Kevin Wolf 3 years, 9 months ago
Am 16.07.2020 um 14:40 hat Peter Maydell geschrieben:
> On Thu, 9 Jul 2020 at 16:02, Kevin Wolf <kwolf@redhat.com> wrote:
> >
> > We can "fix" it for probably all realistic cases by lowering the speed
> > of the block job significantly. It's still not fully fixed for all
> > theoretical cases, but the pattern of starting a block job that is
> > throttled to a low speed so it will keep running for the next part of
> > the test is very common.
> >
> > Kevin
> >
> > diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> > index 256b2bfbc6..31c028306b 100755
> > --- a/tests/qemu-iotests/030
> > +++ b/tests/qemu-iotests/030
> > @@ -243,7 +243,7 @@ class TestParallelOps(iotests.QMPTestCase):
> >              node_name = 'node%d' % i
> >              job_id = 'stream-%s' % node_name
> >              pending_jobs.append(job_id)
> > -            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
> > +            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=1024)
> >              self.assert_qmp(result, 'return', {})
> >
> >          for job in pending_jobs:
> 
> Any chance we could get this fix into the tree? I've just
> had an unrelated mergebuild test run hit this iotest 030
> failure again...

Sure. I sent a proper patch so I can include it in my next pull request
(probably tomorrow).

Kevin


Re: [PULL 00/12] Block patches
Posted by Eduardo Habkost 3 years, 9 months ago
On Thu, Jul 09, 2020 at 05:02:06PM +0200, Kevin Wolf wrote:
> Am 08.07.2020 um 00:05 hat Eduardo Habkost geschrieben:
> > On Tue, Jul 07, 2020 at 05:28:21PM +0200, Philippe Mathieu-Daudé wrote:
> > > On 6/26/20 12:25 PM, Stefan Hajnoczi wrote:
> > > > On Thu, Jun 25, 2020 at 02:31:14PM +0100, Peter Maydell wrote:
> > > >> On Wed, 24 Jun 2020 at 11:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > > >>>
> > > >>> The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:
> > > >>>
> > > >>>   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)
> > > >>>
> > > >>> are available in the Git repository at:
> > > >>>
> > > >>>   https://github.com/stefanha/qemu.git tags/block-pull-request
> > > >>>
> > > >>> for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:
> > > >>>
> > > >>>   block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)
> > > >>>
> > > >>> ----------------------------------------------------------------
> > > >>> Pull request
> > > >>>
> > > >>> ----------------------------------------------------------------
> > > >>
> > > >> Failure on iotest 030, x86-64 Linux:
> > > >>
> > > >>   TEST    iotest-qcow2: 030 [fail]
> > > >> QEMU          --
> > > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64"
> > > >> -nodefaults -display none -accel qtest
> > > >> QEMU_IMG      --
> > > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-img"
> > > >> QEMU_IO       --
> > > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-io"
> > > >>  --cache writeback --aio threads -f qcow2
> > > >> QEMU_NBD      --
> > > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-nbd"
> > > >> IMGFMT        -- qcow2 (compat=1.1)
> > > >> IMGPROTO      -- file
> > > >> PLATFORM      -- Linux/x86_64 e104462 4.15.0-76-generic
> > > >> TEST_DIR      --
> > > >> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/scratch
> > > >> SOCK_DIR      -- /tmp/tmp.8tgdDjoZcO
> > > >> SOCKET_SCM_HELPER --
> > > >> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotest/socket_scm_helper
> > > >>
> > > >> --- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/030.out
> > > >>  2019-07-15 17:18:35.251364738 +0100
> > > >> +++ /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/030.out.bad
> > > >>   2020-06-25 14:04:28.500534007 +0100
> > > >> @@ -1,5 +1,17 @@
> > > >> -...........................
> > > >> +.............F.............
> > > >> +======================================================================
> > > >> +FAIL: test_stream_parallel (__main__.TestParallelOps)
> > > >> +----------------------------------------------------------------------
> > > >> +Traceback (most recent call last):
> > > >> +  File "030", line 246, in test_stream_parallel
> > > >> +    self.assert_qmp(result, 'return', {})
> > > >> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > > >> line 848, in assert_qmp
> > > >> +    result = self.dictpath(d, path)
> > > >> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > > >> line 822, in dictpath
> > > >> +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> > > >> +AssertionError: failed path traversal for "return" in "{'error':
> > > >> {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not
> > > >> found"}}"
> > > >> +
> > > >>  ----------------------------------------------------------------------
> > > >>  Ran 27 tests
> > > >>
> > > >> -OK
> > > >> +FAILED (failures=1)
> > > > 
> > > > Strange, I can't reproduce this failure on my pull request branch or on
> > > > qemu.git/master.
> > > > 
> > > > Is this failure deterministic? Are you sure it is introduced by this
> > > > pull request?
> > > 
> > > Probably not introduced by this pullreq, but I also hit it on FreeBSD:
> > > https://cirrus-ci.com/task/4620718312783872?command=main#L5803
> > > 
> > >   TEST    iotest-qcow2: 030 [fail]
> > > QEMU          --
> > > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../aarch64-softmmu/qemu-system-aarch64"
> > > -nodefaults -display none -machine virt -accel qtest
> > > QEMU_IMG      --
> > > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-img"
> > > QEMU_IO       --
> > > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-io"  --cache
> > > writeback --aio threads -f qcow2
> > > QEMU_NBD      --
> > > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-nbd"
> > > IMGFMT        -- qcow2 (compat=1.1)
> > > IMGPROTO      -- file
> > > PLATFORM      -- FreeBSD/amd64 cirrus-task-4620718312783872 12.1-RELEASE
> > > TEST_DIR      -- /tmp/cirrus-ci-build/build/tests/qemu-iotests/scratch
> > > SOCK_DIR      -- /tmp/tmp.aZ5pxFLF
> > > SOCKET_SCM_HELPER --
> > > --- /tmp/cirrus-ci-build/tests/qemu-iotests/030.out	2020-07-07
> > > 14:48:48.123804000 +0000
> > > +++ /tmp/cirrus-ci-build/build/tests/qemu-iotests/030.out.bad	2020-07-07
> > > 15:05:07.863685000 +0000
> > > @@ -1,5 +1,17 @@
> > > -...........................
> > > +.............F.............
> > > +======================================================================
> > > +FAIL: test_stream_parallel (__main__.TestParallelOps)
> > >  ----------------------------------------------------------------------
> > > +Traceback (most recent call last):
> > > +  File "030", line 246, in test_stream_parallel
> > > +    self.assert_qmp(result, 'return', {})
> > > +  File "/tmp/cirrus-ci-build/tests/qemu-iotests/iotests.py", line 848,
> > > in assert_qmp
> > > +    result = self.dictpath(d, path)
> > > +  File "/tmp/cirrus-ci-build/tests/qemu-iotests/iotests.py", line 822,
> > > in dictpath
> > > +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> > > +AssertionError: failed path traversal for "return" in "{'error':
> > > {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not found"}}"
> > > +
> > > +----------------------------------------------------------------------
> > >  Ran 27 tests
> > 
> > Looks like a race condition that can be forced with a sleep call.
> > With the following patch, I can reproduce it every time:
> > 
> >   diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> >   index 1cdd7e2999..ee5374fc22 100755
> >   --- a/tests/qemu-iotests/030
> >   +++ b/tests/qemu-iotests/030
> >   @@ -241,6 +241,7 @@ class TestParallelOps(iotests.QMPTestCase):
> >                result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
> >                self.assert_qmp(result, 'return', {})
> >   
> >   +        time.sleep(3)
> >            for job in pending_jobs:
> >                result = self.vm.qmp('block-job-set-speed', device=job, speed=0)
> >                self.assert_qmp(result, 'return', {})
> 
> We can "fix" it for probably all realistic cases by lowering the speed
> of the block job significantly. It's still not fully fixed for all
> theoretical cases, but the pattern of starting a block job that is
> throttled to a low speed so it will keep running for the next part of
> the test is very common.
> 
> Kevin
> 
> diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> index 256b2bfbc6..31c028306b 100755
> --- a/tests/qemu-iotests/030
> +++ b/tests/qemu-iotests/030
> @@ -243,7 +243,7 @@ class TestParallelOps(iotests.QMPTestCase):
>              node_name = 'node%d' % i
>              job_id = 'stream-%s' % node_name
>              pending_jobs.append(job_id)
> -            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
> +            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=1024)
>              self.assert_qmp(result, 'return', {})
> 
>          for job in pending_jobs:

Sounds good to me.  This would change the expected job completion
time for the 2-4 MB images from 4-8 seconds to ~30-60 minutes,
right?

This is also a nice way to be sure (block-job-set-speed speed=0)
is really working as expected.

-- 
Eduardo


Re: [PULL 00/12] Block patches
Posted by Kevin Wolf 3 years, 9 months ago
Am 09.07.2020 um 20:41 hat Eduardo Habkost geschrieben:
> On Thu, Jul 09, 2020 at 05:02:06PM +0200, Kevin Wolf wrote:
> > Am 08.07.2020 um 00:05 hat Eduardo Habkost geschrieben:
> > > On Tue, Jul 07, 2020 at 05:28:21PM +0200, Philippe Mathieu-Daudé wrote:
> > > > On 6/26/20 12:25 PM, Stefan Hajnoczi wrote:
> > > > > On Thu, Jun 25, 2020 at 02:31:14PM +0100, Peter Maydell wrote:
> > > > >> On Wed, 24 Jun 2020 at 11:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > > > >>>
> > > > >>> The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:
> > > > >>>
> > > > >>>   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)
> > > > >>>
> > > > >>> are available in the Git repository at:
> > > > >>>
> > > > >>>   https://github.com/stefanha/qemu.git tags/block-pull-request
> > > > >>>
> > > > >>> for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:
> > > > >>>
> > > > >>>   block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)
> > > > >>>
> > > > >>> ----------------------------------------------------------------
> > > > >>> Pull request
> > > > >>>
> > > > >>> ----------------------------------------------------------------
> > > > >>
> > > > >> Failure on iotest 030, x86-64 Linux:
> > > > >>
> > > > >>   TEST    iotest-qcow2: 030 [fail]
> > > > >> QEMU          --
> > > > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64"
> > > > >> -nodefaults -display none -accel qtest
> > > > >> QEMU_IMG      --
> > > > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-img"
> > > > >> QEMU_IO       --
> > > > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-io"
> > > > >>  --cache writeback --aio threads -f qcow2
> > > > >> QEMU_NBD      --
> > > > >> "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-nbd"
> > > > >> IMGFMT        -- qcow2 (compat=1.1)
> > > > >> IMGPROTO      -- file
> > > > >> PLATFORM      -- Linux/x86_64 e104462 4.15.0-76-generic
> > > > >> TEST_DIR      --
> > > > >> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/scratch
> > > > >> SOCK_DIR      -- /tmp/tmp.8tgdDjoZcO
> > > > >> SOCKET_SCM_HELPER --
> > > > >> /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotest/socket_scm_helper
> > > > >>
> > > > >> --- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/030.out
> > > > >>  2019-07-15 17:18:35.251364738 +0100
> > > > >> +++ /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/030.out.bad
> > > > >>   2020-06-25 14:04:28.500534007 +0100
> > > > >> @@ -1,5 +1,17 @@
> > > > >> -...........................
> > > > >> +.............F.............
> > > > >> +======================================================================
> > > > >> +FAIL: test_stream_parallel (__main__.TestParallelOps)
> > > > >> +----------------------------------------------------------------------
> > > > >> +Traceback (most recent call last):
> > > > >> +  File "030", line 246, in test_stream_parallel
> > > > >> +    self.assert_qmp(result, 'return', {})
> > > > >> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > > > >> line 848, in assert_qmp
> > > > >> +    result = self.dictpath(d, path)
> > > > >> +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > > > >> line 822, in dictpath
> > > > >> +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> > > > >> +AssertionError: failed path traversal for "return" in "{'error':
> > > > >> {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not
> > > > >> found"}}"
> > > > >> +
> > > > >>  ----------------------------------------------------------------------
> > > > >>  Ran 27 tests
> > > > >>
> > > > >> -OK
> > > > >> +FAILED (failures=1)
> > > > > 
> > > > > Strange, I can't reproduce this failure on my pull request branch or on
> > > > > qemu.git/master.
> > > > > 
> > > > > Is this failure deterministic? Are you sure it is introduced by this
> > > > > pull request?
> > > > 
> > > > Probably not introduced by this pullreq, but I also hit it on FreeBSD:
> > > > https://cirrus-ci.com/task/4620718312783872?command=main#L5803
> > > > 
> > > >   TEST    iotest-qcow2: 030 [fail]
> > > > QEMU          --
> > > > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../aarch64-softmmu/qemu-system-aarch64"
> > > > -nodefaults -display none -machine virt -accel qtest
> > > > QEMU_IMG      --
> > > > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-img"
> > > > QEMU_IO       --
> > > > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-io"  --cache
> > > > writeback --aio threads -f qcow2
> > > > QEMU_NBD      --
> > > > "/tmp/cirrus-ci-build/build/tests/qemu-iotests/../../qemu-nbd"
> > > > IMGFMT        -- qcow2 (compat=1.1)
> > > > IMGPROTO      -- file
> > > > PLATFORM      -- FreeBSD/amd64 cirrus-task-4620718312783872 12.1-RELEASE
> > > > TEST_DIR      -- /tmp/cirrus-ci-build/build/tests/qemu-iotests/scratch
> > > > SOCK_DIR      -- /tmp/tmp.aZ5pxFLF
> > > > SOCKET_SCM_HELPER --
> > > > --- /tmp/cirrus-ci-build/tests/qemu-iotests/030.out	2020-07-07
> > > > 14:48:48.123804000 +0000
> > > > +++ /tmp/cirrus-ci-build/build/tests/qemu-iotests/030.out.bad	2020-07-07
> > > > 15:05:07.863685000 +0000
> > > > @@ -1,5 +1,17 @@
> > > > -...........................
> > > > +.............F.............
> > > > +======================================================================
> > > > +FAIL: test_stream_parallel (__main__.TestParallelOps)
> > > >  ----------------------------------------------------------------------
> > > > +Traceback (most recent call last):
> > > > +  File "030", line 246, in test_stream_parallel
> > > > +    self.assert_qmp(result, 'return', {})
> > > > +  File "/tmp/cirrus-ci-build/tests/qemu-iotests/iotests.py", line 848,
> > > > in assert_qmp
> > > > +    result = self.dictpath(d, path)
> > > > +  File "/tmp/cirrus-ci-build/tests/qemu-iotests/iotests.py", line 822,
> > > > in dictpath
> > > > +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> > > > +AssertionError: failed path traversal for "return" in "{'error':
> > > > {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not found"}}"
> > > > +
> > > > +----------------------------------------------------------------------
> > > >  Ran 27 tests
> > > 
> > > Looks like a race condition that can be forced with a sleep call.
> > > With the following patch, I can reproduce it every time:
> > > 
> > >   diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> > >   index 1cdd7e2999..ee5374fc22 100755
> > >   --- a/tests/qemu-iotests/030
> > >   +++ b/tests/qemu-iotests/030
> > >   @@ -241,6 +241,7 @@ class TestParallelOps(iotests.QMPTestCase):
> > >                result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
> > >                self.assert_qmp(result, 'return', {})
> > >   
> > >   +        time.sleep(3)
> > >            for job in pending_jobs:
> > >                result = self.vm.qmp('block-job-set-speed', device=job, speed=0)
> > >                self.assert_qmp(result, 'return', {})
> > 
> > We can "fix" it for probably all realistic cases by lowering the speed
> > of the block job significantly. It's still not fully fixed for all
> > theoretical cases, but the pattern of starting a block job that is
> > throttled to a low speed so it will keep running for the next part of
> > the test is very common.
> > 
> > Kevin
> > 
> > diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> > index 256b2bfbc6..31c028306b 100755
> > --- a/tests/qemu-iotests/030
> > +++ b/tests/qemu-iotests/030
> > @@ -243,7 +243,7 @@ class TestParallelOps(iotests.QMPTestCase):
> >              node_name = 'node%d' % i
> >              job_id = 'stream-%s' % node_name
> >              pending_jobs.append(job_id)
> > -            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
> > +            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=1024)
> >              self.assert_qmp(result, 'return', {})
> > 
> >          for job in pending_jobs:
> 
> Sounds good to me.  This would change the expected job completion
> time for the 2-4 MB images from 4-8 seconds to ~30-60 minutes,
> right?

I'm not sure about the granularity in which it really happens, but the
theory is that we have 2 MB of data in each image, so with 1024 bytes
per second, it should take 2048 seconds = ~34 minutes. And if we don't
manage to start and unthrottle four jobs within 34 minutes, we'll have
more problems that just that. :-)

> This is also a nice way to be sure (block-job-set-speed speed=0)
> is really working as expected.

speed=0 means unlimited, so this doesn't work for avoiding to make any
progress. It's what the next loop does to actually get the jobs
completed without waiting that long.

Kevin


Re: [PULL 00/12] Block patches
Posted by Peter Maydell 3 years, 10 months ago
On Fri, 26 Jun 2020 at 11:25, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> On Thu, Jun 25, 2020 at 02:31:14PM +0100, Peter Maydell wrote:
> > On Wed, 24 Jun 2020 at 11:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > >
> > > The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:
> > >
> > >   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)
> > >
> > > are available in the Git repository at:
> > >
> > >   https://github.com/stefanha/qemu.git tags/block-pull-request
> > >
> > > for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:
> > >
> > >   block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)
> > >
> > > ----------------------------------------------------------------
> > > Pull request
> > >
> > > ----------------------------------------------------------------
> >
> > Failure on iotest 030, x86-64 Linux:
> >
> >   TEST    iotest-qcow2: 030 [fail]
> > QEMU          --
> > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64"
> > -nodefaults -display none -accel qtest
> > QEMU_IMG      --
> > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-img"
> > QEMU_IO       --
> > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-io"
> >  --cache writeback --aio threads -f qcow2
> > QEMU_NBD      --
> > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-nbd"
> > IMGFMT        -- qcow2 (compat=1.1)
> > IMGPROTO      -- file
> > PLATFORM      -- Linux/x86_64 e104462 4.15.0-76-generic
> > TEST_DIR      --
> > /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/scratch
> > SOCK_DIR      -- /tmp/tmp.8tgdDjoZcO
> > SOCKET_SCM_HELPER --
> > /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotest/socket_scm_helper
> >
> > --- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/030.out
> >  2019-07-15 17:18:35.251364738 +0100
> > +++ /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/030.out.bad
> >   2020-06-25 14:04:28.500534007 +0100
> > @@ -1,5 +1,17 @@
> > -...........................
> > +.............F.............
> > +======================================================================
> > +FAIL: test_stream_parallel (__main__.TestParallelOps)
> > +----------------------------------------------------------------------
> > +Traceback (most recent call last):
> > +  File "030", line 246, in test_stream_parallel
> > +    self.assert_qmp(result, 'return', {})
> > +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > line 848, in assert_qmp
> > +    result = self.dictpath(d, path)
> > +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > line 822, in dictpath
> > +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> > +AssertionError: failed path traversal for "return" in "{'error':
> > {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not
> > found"}}"
> > +
> >  ----------------------------------------------------------------------
> >  Ran 27 tests
> >
> > -OK
> > +FAILED (failures=1)
>
> Strange, I can't reproduce this failure on my pull request branch or on
> qemu.git/master.
>
> Is this failure deterministic? Are you sure it is introduced by this
> pull request?

It might be a random one that you got hit by; I just bounced
the request because it's a block pullreq rather than anything
obviously unrelated (and because I hadn't seen it before). I
can have another go at merging this if you don't think it looks
like it would be something caused by any of the patches in
this series.

thanks
-- PMM

Re: [PULL 00/12] Block patches
Posted by Stefan Hajnoczi 3 years, 10 months ago
On Fri, Jun 26, 2020 at 11:49 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Fri, 26 Jun 2020 at 11:25, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> >
> > On Thu, Jun 25, 2020 at 02:31:14PM +0100, Peter Maydell wrote:
> > > On Wed, 24 Jun 2020 at 11:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > > >
> > > > The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:
> > > >
> > > >   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)
> > > >
> > > > are available in the Git repository at:
> > > >
> > > >   https://github.com/stefanha/qemu.git tags/block-pull-request
> > > >
> > > > for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:
> > > >
> > > >   block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)
> > > >
> > > > ----------------------------------------------------------------
> > > > Pull request
> > > >
> > > > ----------------------------------------------------------------
> > >
> > > Failure on iotest 030, x86-64 Linux:
> > >
> > >   TEST    iotest-qcow2: 030 [fail]
> > > QEMU          --
> > > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64"
> > > -nodefaults -display none -accel qtest
> > > QEMU_IMG      --
> > > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-img"
> > > QEMU_IO       --
> > > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-io"
> > >  --cache writeback --aio threads -f qcow2
> > > QEMU_NBD      --
> > > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-nbd"
> > > IMGFMT        -- qcow2 (compat=1.1)
> > > IMGPROTO      -- file
> > > PLATFORM      -- Linux/x86_64 e104462 4.15.0-76-generic
> > > TEST_DIR      --
> > > /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/scratch
> > > SOCK_DIR      -- /tmp/tmp.8tgdDjoZcO
> > > SOCKET_SCM_HELPER --
> > > /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotest/socket_scm_helper
> > >
> > > --- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/030.out
> > >  2019-07-15 17:18:35.251364738 +0100
> > > +++ /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/030.out.bad
> > >   2020-06-25 14:04:28.500534007 +0100
> > > @@ -1,5 +1,17 @@
> > > -...........................
> > > +.............F.............
> > > +======================================================================
> > > +FAIL: test_stream_parallel (__main__.TestParallelOps)
> > > +----------------------------------------------------------------------
> > > +Traceback (most recent call last):
> > > +  File "030", line 246, in test_stream_parallel
> > > +    self.assert_qmp(result, 'return', {})
> > > +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > > line 848, in assert_qmp
> > > +    result = self.dictpath(d, path)
> > > +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > > line 822, in dictpath
> > > +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> > > +AssertionError: failed path traversal for "return" in "{'error':
> > > {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not
> > > found"}}"
> > > +
> > >  ----------------------------------------------------------------------
> > >  Ran 27 tests
> > >
> > > -OK
> > > +FAILED (failures=1)
> >
> > Strange, I can't reproduce this failure on my pull request branch or on
> > qemu.git/master.
> >
> > Is this failure deterministic? Are you sure it is introduced by this
> > pull request?
>
> It might be a random one that you got hit by; I just bounced
> the request because it's a block pullreq rather than anything
> obviously unrelated (and because I hadn't seen it before). I
> can have another go at merging this if you don't think it looks
> like it would be something caused by any of the patches in
> this series.

Yes, please try the test again. None of the patches should affect
qemu-iotests 030.

Stefan

Re: [PULL 00/12] Block patches
Posted by Peter Maydell 3 years, 10 months ago
On Fri, 26 Jun 2020 at 14:01, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>
> On Fri, Jun 26, 2020 at 11:49 AM Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Fri, 26 Jun 2020 at 11:25, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > >
> > > On Thu, Jun 25, 2020 at 02:31:14PM +0100, Peter Maydell wrote:
> > > > On Wed, 24 Jun 2020 at 11:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > > > >
> > > > > The following changes since commit 171199f56f5f9bdf1e5d670d09ef1351d8f01bae:
> > > > >
> > > > >   Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200619-3' into staging (2020-06-22 14:45:25 +0100)
> > > > >
> > > > > are available in the Git repository at:
> > > > >
> > > > >   https://github.com/stefanha/qemu.git tags/block-pull-request
> > > > >
> > > > > for you to fetch changes up to 7838c67f22a81fcf669785cd6c0876438422071a:
> > > > >
> > > > >   block/nvme: support nested aio_poll() (2020-06-23 15:46:08 +0100)
> > > > >
> > > > > ----------------------------------------------------------------
> > > > > Pull request
> > > > >
> > > > > ----------------------------------------------------------------
> > > >
> > > > Failure on iotest 030, x86-64 Linux:
> > > >
> > > >   TEST    iotest-qcow2: 030 [fail]
> > > > QEMU          --
> > > > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x86_64"
> > > > -nodefaults -display none -accel qtest
> > > > QEMU_IMG      --
> > > > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-img"
> > > > QEMU_IO       --
> > > > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-io"
> > > >  --cache writeback --aio threads -f qcow2
> > > > QEMU_NBD      --
> > > > "/home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/../../qemu-nbd"
> > > > IMGFMT        -- qcow2 (compat=1.1)
> > > > IMGPROTO      -- file
> > > > PLATFORM      -- Linux/x86_64 e104462 4.15.0-76-generic
> > > > TEST_DIR      --
> > > > /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/scratch
> > > > SOCK_DIR      -- /tmp/tmp.8tgdDjoZcO
> > > > SOCKET_SCM_HELPER --
> > > > /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotest/socket_scm_helper
> > > >
> > > > --- /home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/030.out
> > > >  2019-07-15 17:18:35.251364738 +0100
> > > > +++ /home/petmay01/linaro/qemu-for-merges/build/alldbg/tests/qemu-iotests/030.out.bad
> > > >   2020-06-25 14:04:28.500534007 +0100
> > > > @@ -1,5 +1,17 @@
> > > > -...........................
> > > > +.............F.............
> > > > +======================================================================
> > > > +FAIL: test_stream_parallel (__main__.TestParallelOps)
> > > > +----------------------------------------------------------------------
> > > > +Traceback (most recent call last):
> > > > +  File "030", line 246, in test_stream_parallel
> > > > +    self.assert_qmp(result, 'return', {})
> > > > +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > > > line 848, in assert_qmp
> > > > +    result = self.dictpath(d, path)
> > > > +  File "/home/petmay01/linaro/qemu-for-merges/tests/qemu-iotests/iotests.py",
> > > > line 822, in dictpath
> > > > +    self.fail(f'failed path traversal for "{path}" in "{d}"')
> > > > +AssertionError: failed path traversal for "return" in "{'error':
> > > > {'class': 'DeviceNotActive', 'desc': "Block job 'stream-node8' not
> > > > found"}}"
> > > > +
> > > >  ----------------------------------------------------------------------
> > > >  Ran 27 tests
> > > >
> > > > -OK
> > > > +FAILED (failures=1)
> > >
> > > Strange, I can't reproduce this failure on my pull request branch or on
> > > qemu.git/master.
> > >
> > > Is this failure deterministic? Are you sure it is introduced by this
> > > pull request?
> >
> > It might be a random one that you got hit by; I just bounced
> > the request because it's a block pullreq rather than anything
> > obviously unrelated (and because I hadn't seen it before). I
> > can have another go at merging this if you don't think it looks
> > like it would be something caused by any of the patches in
> > this series.
>
> Yes, please try the test again. None of the patches should affect
> qemu-iotests 030

Seemed to work this time.


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.1
for any user-visible changes.

-- PMM