thebeanogamer / rpms / qemu-kvm

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