All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system
@ 2018-07-24  8:47 Fam Zheng
  2018-07-24  8:47 ` [Qemu-devel] [PATCH 1/2] docs: Describe using images in writing iotests Fam Zheng
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Fam Zheng @ 2018-07-24  8:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: jsnow, Kevin Wolf, Max Reitz, qemu-block, eblake

Something has locked /dev/null on my system (I still don't know what to do with
the annoying incapability of lslocks, or more precisely /proc/locks, on
inspecting OFD lock information), and as a result 226 cannot pass due to the
unexpected image locking error.

Fix the test case by disabling locking, and add a doc text about using test
images.

Fam Zheng (2):
  docs: Describe using images in writing iotests
  iotests: Don't lock /dev/null in 226

 docs/devel/testing.rst | 11 +++++++++++
 tests/qemu-iotests/226 |  4 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 1/2] docs: Describe using images in writing iotests
  2018-07-24  8:47 [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system Fam Zheng
@ 2018-07-24  8:47 ` Fam Zheng
  2018-07-24  8:47 ` [Qemu-devel] [PATCH 2/2] iotests: Don't lock /dev/null in 226 Fam Zheng
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2018-07-24  8:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: jsnow, Kevin Wolf, Max Reitz, qemu-block, eblake

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 docs/devel/testing.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index 5e19cd50da..8e1fa3a66e 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -255,6 +255,17 @@ comparable library support for invoking and interacting with QEMU programs. If
 you opt for Python, it is strongly recommended to write Python 3 compatible
 code.
 
+Both Python and Bash frameworks in iotests provide helpers to manage test
+images. They can be used to create and clean up images under the test
+directory. If no I/O or any protocol specific feature is needed, it is often
+more convenient to use the pseudo block driver, ``null-co://``, as the test
+image, which doesn't require image creation or cleaning up. Avoid system-wide
+devices or files whenever possible, such as ``/dev/null`` or ``/dev/zero``.
+Otherwise, image locking implications have to be considered.  For example,
+another application on the host may have locked the file, possibly leading to a
+test failure.  If using such devices are explicitly desired, consider adding
+``locking=off`` option to disable image locking.
+
 Docker based tests
 ==================
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 2/2] iotests: Don't lock /dev/null in 226
  2018-07-24  8:47 [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system Fam Zheng
  2018-07-24  8:47 ` [Qemu-devel] [PATCH 1/2] docs: Describe using images in writing iotests Fam Zheng
@ 2018-07-24  8:47 ` Fam Zheng
  2018-07-24 14:44 ` [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system Eric Blake
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2018-07-24  8:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: jsnow, Kevin Wolf, Max Reitz, qemu-block, eblake

On my system (Fedora 28), this script reports a 'failed to get
"consistent read" lock' error. Following docs/devel/testing.rst, it's
better to add locking=off here.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/226 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/226 b/tests/qemu-iotests/226
index 211ea9888a..8ec3e612dd 100755
--- a/tests/qemu-iotests/226
+++ b/tests/qemu-iotests/226
@@ -56,10 +56,10 @@ for PROTO in "file" "host_device" "host_cdrom"; do
     echo
     echo "== Testing RO =="
     $QEMU_IO -c "open -r -o driver=$PROTO,filename=$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
-    $QEMU_IO -c "open -r -o driver=$PROTO,filename=/dev/null" 2>&1 | _filter_imgfmt
+    $QEMU_IO -c "open -r -o driver=$PROTO,filename=/dev/null,locking=off" 2>&1 | _filter_imgfmt
     echo "== Testing RW =="
     $QEMU_IO -c "open -o driver=$PROTO,filename=$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
-    $QEMU_IO -c "open -o driver=$PROTO,filename=/dev/null" 2>&1 | _filter_imgfmt
+    $QEMU_IO -c "open -o driver=$PROTO,filename=/dev/null,locking=off" 2>&1 | _filter_imgfmt
 done
 
 # success, all done
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system
  2018-07-24  8:47 [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system Fam Zheng
  2018-07-24  8:47 ` [Qemu-devel] [PATCH 1/2] docs: Describe using images in writing iotests Fam Zheng
  2018-07-24  8:47 ` [Qemu-devel] [PATCH 2/2] iotests: Don't lock /dev/null in 226 Fam Zheng
@ 2018-07-24 14:44 ` Eric Blake
  2018-07-24 18:03 ` John Snow
  2018-07-27  9:24 ` Fam Zheng
  4 siblings, 0 replies; 8+ messages in thread
From: Eric Blake @ 2018-07-24 14:44 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: jsnow, Kevin Wolf, Max Reitz, qemu-block

On 07/24/2018 03:47 AM, Fam Zheng wrote:
> Something has locked /dev/null on my system (I still don't know what to do with
> the annoying incapability of lslocks, or more precisely /proc/locks, on
> inspecting OFD lock information), and as a result 226 cannot pass due to the
> unexpected image locking error.
> 
> Fix the test case by disabling locking, and add a doc text about using test
> images.
> 
> Fam Zheng (2):
>    docs: Describe using images in writing iotests
>    iotests: Don't lock /dev/null in 226
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

>   docs/devel/testing.rst | 11 +++++++++++
>   tests/qemu-iotests/226 |  4 ++--
>   2 files changed, 13 insertions(+), 2 deletions(-)
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system
  2018-07-24  8:47 [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system Fam Zheng
                   ` (2 preceding siblings ...)
  2018-07-24 14:44 ` [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system Eric Blake
@ 2018-07-24 18:03 ` John Snow
  2018-07-27  9:24 ` Fam Zheng
  4 siblings, 0 replies; 8+ messages in thread
From: John Snow @ 2018-07-24 18:03 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Kevin Wolf, qemu-block, Max Reitz



On 07/24/2018 04:47 AM, Fam Zheng wrote:
> Something has locked /dev/null on my system (I still don't know what to do with
> the annoying incapability of lslocks, or more precisely /proc/locks, on
> inspecting OFD lock information), and as a result 226 cannot pass due to the
> unexpected image locking error.
> 
> Fix the test case by disabling locking, and add a doc text about using test
> images.
> 
> Fam Zheng (2):
>   docs: Describe using images in writing iotests
>   iotests: Don't lock /dev/null in 226
> 
>  docs/devel/testing.rst | 11 +++++++++++
>  tests/qemu-iotests/226 |  4 ++--
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 

I think this is the better approach for now, yeah. Sorry my test caused
so many problems... :[

Reviewed-by: John Snow <jsnow@redhat.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system
  2018-07-24  8:47 [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system Fam Zheng
                   ` (3 preceding siblings ...)
  2018-07-24 18:03 ` John Snow
@ 2018-07-27  9:24 ` Fam Zheng
  2018-07-27 10:04   ` Kevin Wolf
  4 siblings, 1 reply; 8+ messages in thread
From: Fam Zheng @ 2018-07-27  9:24 UTC (permalink / raw)
  To: Kevin Wolf, qemu-devel

On Tue, 07/24 16:47, Fam Zheng wrote:
> Something has locked /dev/null on my system (I still don't know what to do with
> the annoying incapability of lslocks, or more precisely /proc/locks, on
> inspecting OFD lock information), and as a result 226 cannot pass due to the
> unexpected image locking error.
> 
> Fix the test case by disabling locking, and add a doc text about using test
> images.
> 
> Fam Zheng (2):
>   docs: Describe using images in writing iotests
>   iotests: Don't lock /dev/null in 226
> 
>  docs/devel/testing.rst | 11 +++++++++++
>  tests/qemu-iotests/226 |  4 ++--
>  2 files changed, 13 insertions(+), 2 deletions(-)

Kevin, could you apply this for 3.0 too?

Fam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system
  2018-07-27  9:24 ` Fam Zheng
@ 2018-07-27 10:04   ` Kevin Wolf
  2018-07-27 12:17     ` Fam Zheng
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Wolf @ 2018-07-27 10:04 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel

Am 27.07.2018 um 11:24 hat Fam Zheng geschrieben:
> On Tue, 07/24 16:47, Fam Zheng wrote:
> > Something has locked /dev/null on my system (I still don't know what to do with
> > the annoying incapability of lslocks, or more precisely /proc/locks, on
> > inspecting OFD lock information), and as a result 226 cannot pass due to the
> > unexpected image locking error.
> > 
> > Fix the test case by disabling locking, and add a doc text about using test
> > images.
> > 
> > Fam Zheng (2):
> >   docs: Describe using images in writing iotests
> >   iotests: Don't lock /dev/null in 226
> > 
> >  docs/devel/testing.rst | 11 +++++++++++
> >  tests/qemu-iotests/226 |  4 ++--
> >  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> Kevin, could you apply this for 3.0 too?

Sure, applied to the block branch.

Out of curiosity, did you find out what had locked the devices?

Kevin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system
  2018-07-27 10:04   ` Kevin Wolf
@ 2018-07-27 12:17     ` Fam Zheng
  0 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2018-07-27 12:17 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: QEMU Developers

On Fri, Jul 27, 2018 at 6:04 PM Kevin Wolf <kwolf@redhat.com> wrote:
>
> Am 27.07.2018 um 11:24 hat Fam Zheng geschrieben:
> > On Tue, 07/24 16:47, Fam Zheng wrote:
> > > Something has locked /dev/null on my system (I still don't know what to do with
> > > the annoying incapability of lslocks, or more precisely /proc/locks, on
> > > inspecting OFD lock information), and as a result 226 cannot pass due to the
> > > unexpected image locking error.
> > >
> > > Fix the test case by disabling locking, and add a doc text about using test
> > > images.
> > >
> > > Fam Zheng (2):
> > >   docs: Describe using images in writing iotests
> > >   iotests: Don't lock /dev/null in 226
> > >
> > >  docs/devel/testing.rst | 11 +++++++++++
> > >  tests/qemu-iotests/226 |  4 ++--
> > >  2 files changed, 13 insertions(+), 2 deletions(-)
> >
> > Kevin, could you apply this for 3.0 too?
>
> Sure, applied to the block branch.
>
> Out of curiosity, did you find out what had locked the devices?

No, but I'll for sure allocate some time to understand kernel's OFD
internals, find the holder application, then hopefully, propose
something that can fix lslocks.

Thanks,
Fam

>
> Kevin

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-07-27 12:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-24  8:47 [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system Fam Zheng
2018-07-24  8:47 ` [Qemu-devel] [PATCH 1/2] docs: Describe using images in writing iotests Fam Zheng
2018-07-24  8:47 ` [Qemu-devel] [PATCH 2/2] iotests: Don't lock /dev/null in 226 Fam Zheng
2018-07-24 14:44 ` [Qemu-devel] [PATCH 0/2] iotests: Fix 226 on _my_ system Eric Blake
2018-07-24 18:03 ` John Snow
2018-07-27  9:24 ` Fam Zheng
2018-07-27 10:04   ` Kevin Wolf
2018-07-27 12:17     ` Fam Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.