Skip to contentSkip to conversation

iotests: Let 245 pass on tmpfs

PATCH Applied Max Reitz 5 participants 6 messages Apr 10, 2019 – Apr 11, 2019

lore
Share & tools
lore

Max Reitz

author
#0 lore raw

PATCH 1/1 iotests: Let 245 pass on tmpfs

tmpfs does not support O_DIRECT. Detect this case, and skip flipping @direct if the filesystem does not support it.

Fixes bf3e50f6239090e63a8ffaaec971671e66d88e07
---
 tests/qemu-iotests/245 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
tests/qemu-iotests/245 +8 -2
index 7891a210c1..a04c6235c1 100644
@@ -209,6 +209,12 @@ class TestBlockdevReopen(iotests.QMPTestCase):
 
     # Reopen an image several times changing some of its options
     def test_reopen(self):
+        # Check whether the filesystem supports O_DIRECT
+        if 'O_DIRECT' in qemu_io('-f', 'raw', '-t', 'none', '-c', 'quit', hd_path[0]):
+            supports_direct = False
+        else:
+            supports_direct = True
+
         # Open the hd1 image passing all backing options
         opts = hd_opts(1)
         opts['backing'] = hd_opts(0)
@@ -231,9 +237,9 @@ class TestBlockdevReopen(iotests.QMPTestCase):
         self.assert_qmp(self.get_node('hd1'), 'cache/writeback', True)
         self.assert_qmp(self.get_node('hd1'), 'cache/direct', False)
         self.assert_qmp(self.get_node('hd1'), 'cache/no-flush', False)
-        self.reopen(opts, {'cache': { 'direct': True, 'no-flush': True }})
+        self.reopen(opts, {'cache': { 'direct': supports_direct, 'no-flush': True }})
         self.assert_qmp(self.get_node('hd1'), 'cache/writeback', True)
-        self.assert_qmp(self.get_node('hd1'), 'cache/direct', True)
+        self.assert_qmp(self.get_node('hd1'), 'cache/direct', supports_direct)
         self.assert_qmp(self.get_node('hd1'), 'cache/no-flush', True)
 
         # Reopen again with the original options
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Max Reitz

tmpfs does not support O_DIRECT. Detect this case, and skip flipping @direct if the filesystem does not support it.

Fixes bf3e50f6239090e63a8ffaaec971671e66d88e07
---
 tests/qemu-iotests/245 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Are you trying to get this in 4.0-rc3? (As a test, it has no bearing on the actual binaries; fewer testsuite failures are nice if we squeeze it in, but at the same time it is not enough to delay the release if it does not get fixed until 4.1).

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
author
#2 lore raw
Quoted 10 lines · Eric Blake
Quoted 8 lines · Max Reitz

tmpfs does not support O_DIRECT. Detect this case, and skip flipping @direct if the filesystem does not support it.

Fixes bf3e50f6239090e63a8ffaaec971671e66d88e07
---
 tests/qemu-iotests/245 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 6 lines

Are you trying to get this in 4.0-rc3? (As a test, it has no bearing on the actual binaries; fewer testsuite failures are nice if we squeeze it in, but at the same time it is not enough to delay the release if it does not get fixed until 4.1).

If there are other patches for rc3, we could take this as well. But there is no point in making a pull request just for this.

Max

#3 lore raw
Quoted 17 lines · Max Reitz
Quoted 15 lines · Eric Blake
Quoted 8 lines · Max Reitz

tmpfs does not support O_DIRECT. Detect this case, and skip flipping @direct if the filesystem does not support it.

Fixes bf3e50f6239090e63a8ffaaec971671e66d88e07
---
 tests/qemu-iotests/245 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Are you trying to get this in 4.0-rc3? (As a test, it has no bearing on the actual binaries; fewer testsuite failures are nice if we squeeze it in, but at the same time it is not enough to delay the release if it does not get fixed until 4.1).

Quoted 4 lines
Quoted 1 line

If there are other patches for rc3, we could take this as well. But there is no point in making a pull request just for this.

rc3 has been tagged already, I'm afraid. rc4 will be only if something release-critical crops up.

thanks
-- PMM

Reviewed-by on v1 1/1
#4 lore raw
In reply to Max Reitz

tests/qemu-iotests/245 class TestBlockdevReopen(iotests.QMPTestCase): · line 216

Quoted 7 lines · Max Reitz

# Reopen an image several times changing some of its options def test_reopen(self):

tests/qemu-iotests/245 +5 -0
+        # Check whether the filesystem supports O_DIRECT
+        if 'O_DIRECT' in qemu_io('-f', 'raw', '-t', 'none', '-c', 'quit', hd_path[0]):
+            supports_direct = False
+        else:
+            supports_direct = True

I don't see any other test needing this at the moment (at least none written in Python), but I wonder if this is something worth having in iotests.py.

The patch looks fine anyway.

Berto

Applied
#5 lore raw
In reply to Max Reitz

Am 10.04.2019 um 18:29 hat Max Reitz geschrieben:

Quoted 5 lines

tmpfs does not support O_DIRECT. Detect this case, and skip flipping @direct if the filesystem does not support it.

Fixes bf3e50f6239090e63a8ffaaec971671e66d88e07

Thanks, applied to the block branch.

Kevin