Skip to contentSkip to conversation

iotests: Drop deprecated 'props' from object-add

PATCH Superseded Alberto Garcia 3 participants 6 messages Feb 16, 2021 – Feb 19, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iotests: Drop deprecated 'props' from object-add

---
 tests/qemu-iotests/087     |  8 ++------
 tests/qemu-iotests/184     | 18 ++++++------------
 tests/qemu-iotests/218     |  2 +-
 tests/qemu-iotests/235     |  2 +-
 tests/qemu-iotests/245     |  4 ++--
 tests/qemu-iotests/258     |  7 +++----
 tests/qemu-iotests/258.out |  4 ++--
 tests/qemu-iotests/295     |  2 +-
 tests/qemu-iotests/296     |  2 +-
 9 files changed, 19 insertions(+), 30 deletions(-)
tests/qemu-iotests/087 +2 -6
index edd43f1a28..d8e0e384cd 100755
@@ -143,9 +143,7 @@ run_qemu <<EOF
   "arguments": {
       "qom-type": "secret",
       "id": "sec0",
-      "props": {
-          "data": "123456"
-      }
+      "data": "123456"
   }
 }
 { "execute": "blockdev-add",
@@ -176,9 +174,7 @@ run_qemu <<EOF
   "arguments": {
       "qom-type": "secret",
       "id": "sec0",
-      "props": {
-          "data": "123456"
-      }
+      "data": "123456"
   }
 }
 { "execute": "blockdev-add",
tests/qemu-iotests/184 +6 -12
index 513d167098..e4cbcd8634 100755
@@ -67,10 +67,8 @@ run_qemu <<EOF
   "arguments": {
     "qom-type": "throttle-group",
     "id": "group0",
-    "props": {
-      "limits" : {
-        "iops-total": 1000
-      }
+    "limits" : {
+      "iops-total": 1000
     }
   }
 }
@@ -96,10 +94,8 @@ run_qemu <<EOF
   "arguments": {
     "qom-type": "throttle-group",
     "id": "group0",
-    "props" : {
-      "limits": {
-          "iops-total": 1000
-      }
+    "limits": {
+        "iops-total": 1000
     }
   }
 }
@@ -136,10 +132,8 @@ run_qemu <<EOF
   "arguments": {
     "qom-type": "throttle-group",
     "id": "group0",
-    "props" : {
-      "limits": {
-          "iops-total": 1000
-      }
+    "limits": {
+        "iops-total": 1000
     }
   }
 }
tests/qemu-iotests/218 +1 -1
index ae7c4fb187..cbb38923cf 100755
@@ -152,7 +152,7 @@ with iotests.VM() as vm, \
     vm.launch()
 
     ret = vm.qmp('object-add', qom_type='throttle-group', id='tg',
-                 props={'x-bps-read': 4096})
+                 x_bps_read = 4096)
     assert ret['return'] == {}
 
     ret = vm.qmp('blockdev-add',
tests/qemu-iotests/235 +1 -1
index 20d16dbf38..f5c73b9c17 100755
@@ -57,7 +57,7 @@ vm.add_args('-drive', 'id=src,file=' + disk)
 vm.launch()
 
 log(vm.qmp('object-add', qom_type='throttle-group', id='tg0',
-           props={ 'x-bps-total': size }))
+           x_bps_total=size))
 
 log(vm.qmp('blockdev-add',
            **{ 'node-name': 'target',
tests/qemu-iotests/245 +2 -2
index cfdeb902be..30b1d7b22d 100755
@@ -644,12 +644,12 @@ class TestBlockdevReopen(iotests.QMPTestCase):
         ###### throttle ######
         ######################
         opts = { 'qom-type': 'throttle-group', 'id': 'group0',
-                 'props': { 'limits': { 'iops-total': 1000 } } }
+                 'limits': { 'iops-total': 1000 } }
         result = self.vm.qmp('object-add', conv_keys = False, **opts)
         self.assert_qmp(result, 'return', {})
 
         opts = { 'qom-type': 'throttle-group', 'id': 'group1',
-                 'props': { 'limits': { 'iops-total': 2000 } } }
+                 'limits': { 'iops-total': 2000 } }
         result = self.vm.qmp('object-add', conv_keys = False, **opts)
         self.assert_qmp(result, 'return', {})
 
tests/qemu-iotests/258 +3 -4
index 9a2d33ae5e..65ce02501a 100755
@@ -103,10 +103,9 @@ def test_concurrent_finish(write_to_stream_node):
         vm.qmp_log('object-add',
                    qom_type='throttle-group',
                    id='tg',
-                   props={
-                       'x-iops-write': 1,
-                       'x-iops-write-max': 1
-                   })
+                   x_iops_write=1,
+                   x_iops_write_max=1
+                   )
 
         vm.qmp_log('blockdev-add',
                    filters=[filter_qmp_testfiles, filter_qmp_imgfmt],
tests/qemu-iotests/258.out +2 -2
index ce6e9ba3e5..bfcaf97afe 100644
@@ -2,7 +2,7 @@ Running tests:
 
 === Commit and stream finish concurrently (letting stream write) ===
 
-{"execute": "object-add", "arguments": {"id": "tg", "props": {"x-iops-write": 1, "x-iops-write-max": 1}, "qom-type": "throttle-group"}}
+{"execute": "object-add", "arguments": {"id": "tg", "qom-type": "throttle-group", "x-iops-write": 1, "x-iops-write-max": 1}}
 {"return": {}}
 {"execute": "blockdev-add", "arguments": {"backing": {"backing": {"backing": {"backing": {"driver": "raw", "file": {"driver": "file", "filename": "TEST_DIR/PID-node0.img"}, "node-name": "node0"}, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-node1.img"}, "node-name": "node1"}, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-node2.img"}, "node-name": "node2"}, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-node3.img"}, "node-name": "node3"}, "driver": "IMGFMT", "file": {"driver": "throttle", "file": {"driver": "file", "filename": "TEST_DIR/PID-node4.img"}, "throttle-group": "tg"}, "node-name": "node4"}}
 {"return": {}}
@@ -18,7 +18,7 @@ Running tests:
 
 === Commit and stream finish concurrently (letting commit write) ===
 
-{"execute": "object-add", "arguments": {"id": "tg", "props": {"x-iops-write": 1, "x-iops-write-max": 1}, "qom-type": "throttle-group"}}
+{"execute": "object-add", "arguments": {"id": "tg", "qom-type": "throttle-group", "x-iops-write": 1, "x-iops-write-max": 1}}
 {"return": {}}
 {"execute": "blockdev-add", "arguments": {"backing": {"backing": {"backing": {"backing": {"driver": "raw", "file": {"driver": "throttle", "file": {"driver": "file", "filename": "TEST_DIR/PID-node0.img"}, "throttle-group": "tg"}, "node-name": "node0"}, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-node1.img"}, "node-name": "node1"}, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-node2.img"}, "node-name": "node2"}, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-node3.img"}, "node-name": "node3"}, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-node4.img"}, "node-name": "node4"}}
 {"return": {}}
tests/qemu-iotests/295 +1 -1
index 01a6c0b31f..270ad3999f 100755
@@ -43,7 +43,7 @@ class Secret:
 
     def to_qmp_object(self):
         return { "qom_type" : "secret", "id": self.id(),
-                 "props": { "data": self.secret() } }
+                 "data": self.secret() }
 
 ################################################################################
 class EncryptionSetupTestCase(iotests.QMPTestCase):
tests/qemu-iotests/296 +1 -1
index 0bc3c6c7d7..7c65e987a1 100755
@@ -43,7 +43,7 @@ class Secret:
 
     def to_qmp_object(self):
         return { "qom_type" : "secret", "id": self.id(),
-                 "props": { "data": self.secret() } }
+                 "data": self.secret() }
 
 ################################################################################
 
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Alberto Garcia
---
  tests/qemu-iotests/087     |  8 ++------
  tests/qemu-iotests/184     | 18 ++++++------------
  tests/qemu-iotests/218     |  2 +-
  tests/qemu-iotests/235     |  2 +-
  tests/qemu-iotests/245     |  4 ++--
  tests/qemu-iotests/258     |  7 +++----
  tests/qemu-iotests/258.out |  4 ++--
  tests/qemu-iotests/295     |  2 +-
  tests/qemu-iotests/296     |  2 +-
  9 files changed, 19 insertions(+), 30 deletions(-)

Two Python syntax nit picks below.

[...]

tests/qemu-iotests/218 with iotests.VM() as vm, \ · line 155

Quoted 10 lines
tests/qemu-iotests/218 +1 -1
index ae7c4fb187..cbb38923cf 100755
@@ -152,7 +152,7 @@ with iotests.VM() as vm, \
      vm.launch()
 
      ret = vm.qmp('object-add', qom_type='throttle-group', id='tg',
-                 props={'x-bps-read': 4096})
+                 x_bps_read = 4096)

To stay consistent, I think there shouldn’t be spaces around '=' here.

(flake8 thinks so, too)

Quoted 3 lines
tests/qemu-iotests/218 +0 -0
      assert ret['return'] == {}
 
      ret = vm.qmp('blockdev-add',

[..]

Quoted 5 lines
tests/qemu-iotests/258 +0 -0
index 9a2d33ae5e..65ce02501a 100755

tests/qemu-iotests/258 def test_concurrent_finish(write_to_stream_node): · line 108

Quoted 10 lines
tests/qemu-iotests/258 +3 -4
@@ -103,10 +103,9 @@ def test_concurrent_finish(write_to_stream_node):
          vm.qmp_log('object-add',
                     qom_type='throttle-group',
                     id='tg',
-                   props={
-                       'x-iops-write': 1,
-                       'x-iops-write-max': 1
-                   })
+                   x_iops_write=1,
+                   x_iops_write_max=1
+                   )

This indentation looks weird to me now. Unfortunately, flake8 finds this is the only correct indentation, so I have no reason to complain.

Perhaps putting it on the preceding line would be better?

#3 lore raw
In reply to Alberto Garcia

Am 16.02.2021 um 18:16 hat Alberto Garcia geschrieben:

tests/qemu-iotests/235 vm.add_args('-drive', 'id=src,file=' + disk) · line 60

Quoted 12 lines
tests/qemu-iotests/235 +1 -1
index 20d16dbf38..f5c73b9c17 100755
@@ -57,7 +57,7 @@ vm.add_args('-drive', 'id=src,file=' + disk)
 vm.launch()
 
 log(vm.qmp('object-add', qom_type='throttle-group', id='tg0',
-           props={ 'x-bps-total': size }))
+           x_bps_total=size))

x-bps-total isn't a stable interface, I'd prefer to use limits.

My patch from November [1] had this:

tests/qemu-iotests/235 +1 -1
index d1b10ac36b..2765561ada 100755
@@ -56,7 +56,7 @@ vm.add_args('-drive', 'id=src,file=' + disk)
 vm.launch()
 
 log(vm.qmp('object-add', qom_type='throttle-group', id='tg0',
-           props={ 'x-bps-total': size }))
+           limits={ 'bps-total': size }))
 
 log(vm.qmp('blockdev-add',
            **{ 'node-name': 'target',

The same happens in other hunks in the patch.

Actually, I believe I can even merge my patch to drop 'props' while the rest of the object-add QAPIfication series isn't ready yet. Maybe I should just do that.

Kevin

[1] https://lists.gnu.org/archive/html/qemu-block/2020-11/msg00802.html

#2 lore raw
In reply to Max Reitz
Quoted 7 lines · Max Reitz

Two Python syntax nit picks below.

tests/qemu-iotests/218 with iotests.VM() as vm, \ · line 155

Quoted 3 lines
      ret = vm.qmp('object-add', qom_type='throttle-group', id='tg',
tests/qemu-iotests/218 +1 -1
-                 props={'x-bps-read': 4096})
+                 x_bps_read = 4096)

To stay consistent, I think there shouldn’t be spaces around '=' here.

Right, I didn't notice that.

Quoted 15 lines

tests/qemu-iotests/258 def test_concurrent_finish(write_to_stream_node): · line 108

Quoted 11 lines
tests/qemu-iotests/258 +3 -4
@@ -103,10 +103,9 @@ def test_concurrent_finish(write_to_stream_node):
          vm.qmp_log('object-add',
                     qom_type='throttle-group',
                     id='tg',
-                   props={
-                       'x-iops-write': 1,
-                       'x-iops-write-max': 1
-                   })
+                   x_iops_write=1,
+                   x_iops_write_max=1
+                   )

This indentation looks weird to me now. Unfortunately, flake8 finds this is the only correct indentation, so I have no reason to complain.

Quoted 1 line

Perhaps putting it on the preceding line would be better?

I'm fine either way, I can resend the patch with Kevin's suggestions.

Berto

#4 lore raw
In reply to Kevin Wolf
Quoted 7 lines · Kevin Wolf

Review

Quoted 3 lines

log(vm.qmp('object-add', qom_type='throttle-group', id='tg0',

(quoted diff) +1 -1
-           props={ 'x-bps-total': size }))
+           x_bps_total=size))

x-bps-total isn't a stable interface, I'd prefer to use limits.

My patch from November [1] had this:

Do you want me to resend mine, or wait for yours, or what then? :)

Berto

#5 lore raw

Am 19.02.2021 um 13:45 hat Alberto Garcia geschrieben:

Quoted 10 lines · Kevin Wolf
Quoted 7 lines

Review

Quoted 3 lines

log(vm.qmp('object-add', qom_type='throttle-group', id='tg0',

(quoted diff) +1 -1
-           props={ 'x-bps-total': size }))
+           x_bps_total=size))

x-bps-total isn't a stable interface, I'd prefer to use limits.

My patch from November [1] had this:

Do you want me to resend mine, or wait for yours, or what then? :)

It's your patch, you decide. :-)

I haven't compared the patches in detail yet, so if you think merging my patch has the same result and is less work, I can do that. If not and you send a v2, I'll take that. Or you see differences and post review comments to my patch instead of a v2 of yours. I'm fine with any of these options.

Kevin