yeahuh / rpms / qemu-kvm

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