On 18.03.22 21:36, John Snow wrote:
Howdy,

Heya,

[...]

- Uh, actually, test 040 fails with this patchset and I don't understand
   if it's intentional, harmless, a test design problem, or worse:

======================================================================
ERROR: test_filterless_commit (__main__.TestCommitWithFilters)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/home/jsnow/src/qemu/tests/qemu-iotests/040", line 822, in tearDown
     self.do_test_io('read')
   File "/home/jsnow/src/qemu/tests/qemu-iotests/040", line 751, in do_test_io
     qemu_io('-f', iotests.imgfmt,
   File "/home/jsnow/src/qemu/tests/qemu-iotests/iotests.py", line 365, in 
qemu_io
     return qemu_tool(*qemu_io_wrap_args(args),
   File "/home/jsnow/src/qemu/tests/qemu-iotests/iotests.py", line 242, in 
qemu_tool
     raise VerboseProcessError(

qemu.utils.VerboseProcessError: Command
   '('/home/jsnow/src/qemu/bin/git/tests/qemu-iotests/../../qemu-io',
   '--cache', 'writeback', '--aio', 'threads', '-f', 'qcow2', '-c',
   'read -P 4 3M 1M',
   '/home/jsnow/src/qemu/bin/git/tests/qemu-iotests/scratch/3.img')'
   returned non-zero exit status 1.
   ┏━ output ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ┃ qemu-io: can't open device
   ┃ /home/jsnow/src/qemu/bin/git/tests/qemu-iotests/scratch/3.img:
   ┃ Could not open backing file: Could not open backing file: Throttle
   ┃ group 'tg' does not exist
   ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

It looks like we start with the img chain 3->2->1->0, then we commit 2
down into 1, but checking '3' fails somewhere in the backing
chain. Maybe a real bug?

Looks like my hunch was right: The problem is that it’s hard to figure out a good backing file string when there are filters involved, and so in one test here we generate one that contains a JSON description of the backing subgraph including a throttle node. Outside of qemu, that doesn’t make much sense, hence the error.

(And because we checked only for “pattern verification failed” specifically, that error here never surfaced.)

I think (hope?) we can expect management tools to manually specify backing file strings in such cases, like the attached diff does. That seems to fix the problem.

Hanna
diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index c4a90937dc..30eb97829e 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -836,7 +836,8 @@ class TestCommitWithFilters(iotests.QMPTestCase):
                              job_id='commit',
                              device='top-filter',
                              top_node='cow-2',
-                             base_node='cow-1')
+                             base_node='cow-1',
+                             backing_file=self.img1)
         self.assert_qmp(result, 'return', {})
         self.wait_until_completed(drive='commit')
 
@@ -852,7 +853,8 @@ class TestCommitWithFilters(iotests.QMPTestCase):
                              job_id='commit',
                              device='top-filter',
                              top_node='cow-1',
-                             base_node='cow-0')
+                             base_node='cow-0',
+                             backing_file=self.img0)
         self.assert_qmp(result, 'return', {})
         self.wait_until_completed(drive='commit')
 

Reply via email to