902636
From 127360c2fa0fefa18ff828bfec3985e04791d665 Mon Sep 17 00:00:00 2001
902636
From: Kevin Wolf <kwolf@redhat.com>
902636
Date: Wed, 3 Jun 2020 16:03:16 +0100
902636
Subject: [PATCH 17/26] iotests: don't use 'format' for drive_add
902636
MIME-Version: 1.0
902636
Content-Type: text/plain; charset=UTF-8
902636
Content-Transfer-Encoding: 8bit
902636
902636
RH-Author: Kevin Wolf <kwolf@redhat.com>
902636
Message-id: <20200603160325.67506-3-kwolf@redhat.com>
902636
Patchwork-id: 97102
902636
O-Subject: [RHEL-AV-8.2.1 qemu-kvm PATCH v2 02/11] iotests: don't use 'format' for drive_add
902636
Bugzilla: 1778593
902636
RH-Acked-by: Eric Blake <eblake@redhat.com>
902636
RH-Acked-by: Max Reitz <mreitz@redhat.com>
902636
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
902636
902636
From: John Snow <jsnow@redhat.com>
902636
902636
It shadows (with a different type) the built-in format.
902636
Use something else.
902636
902636
Signed-off-by: John Snow <jsnow@redhat.com>
902636
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
902636
Reviewed-by: Max Reitz <mreitz@redhat.com>
902636
Message-Id: <20200331000014.11581-3-jsnow@redhat.com>
902636
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
902636
Signed-off-by: Max Reitz <mreitz@redhat.com>
902636
(cherry picked from commit 1d3d4b630c6ea8b19420c097f0c448b6ded95072)
902636
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
902636
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
902636
---
902636
 tests/qemu-iotests/055        | 3 ++-
902636
 tests/qemu-iotests/iotests.py | 6 +++---
902636
 2 files changed, 5 insertions(+), 4 deletions(-)
902636
902636
diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055
902636
index c732a11..eb50c9f 100755
902636
--- a/tests/qemu-iotests/055
902636
+++ b/tests/qemu-iotests/055
902636
@@ -469,7 +469,8 @@ class TestDriveCompression(iotests.QMPTestCase):
902636
         qemu_img('create', '-f', fmt, blockdev_target_img,
902636
                  str(TestDriveCompression.image_len), *args)
902636
         if attach_target:
902636
-            self.vm.add_drive(blockdev_target_img, format=fmt, interface="none")
902636
+            self.vm.add_drive(blockdev_target_img,
902636
+                              img_format=fmt, interface="none")
902636
 
902636
         self.vm.launch()
902636
 
902636
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
902636
index 46f880c..be20d56 100644
902636
--- a/tests/qemu-iotests/iotests.py
902636
+++ b/tests/qemu-iotests/iotests.py
902636
@@ -481,20 +481,20 @@ class VM(qtest.QEMUQtestMachine):
902636
         self._args.append(opts)
902636
         return self
902636
 
902636
-    def add_drive(self, path, opts='', interface='virtio', format=imgfmt):
902636
+    def add_drive(self, path, opts='', interface='virtio', img_format=imgfmt):
902636
         '''Add a virtio-blk drive to the VM'''
902636
         options = ['if=%s' % interface,
902636
                    'id=drive%d' % self._num_drives]
902636
 
902636
         if path is not None:
902636
             options.append('file=%s' % path)
902636
-            options.append('format=%s' % format)
902636
+            options.append('format=%s' % img_format)
902636
             options.append('cache=%s' % cachemode)
902636
 
902636
         if opts:
902636
             options.append(opts)
902636
 
902636
-        if format == 'luks' and 'key-secret' not in opts:
902636
+        if img_format == 'luks' and 'key-secret' not in opts:
902636
             # default luks support
902636
             if luks_default_secret_object not in self._args:
902636
                 self.add_object(luks_default_secret_object)
902636
-- 
902636
1.8.3.1
902636