iotests: don't use 'format' for drive_add
It shadows (with a different type) the built-in format. Use something else. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200331000014.11581-3-jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
6a96d87cf4
commit
1d3d4b630c
@ -469,7 +469,8 @@ class TestDriveCompression(iotests.QMPTestCase):
|
||||
qemu_img('create', '-f', fmt, blockdev_target_img,
|
||||
str(TestDriveCompression.image_len), *args)
|
||||
if attach_target:
|
||||
self.vm.add_drive(blockdev_target_img, format=fmt, interface="none")
|
||||
self.vm.add_drive(blockdev_target_img,
|
||||
img_format=fmt, interface="none")
|
||||
|
||||
self.vm.launch()
|
||||
|
||||
|
@ -486,21 +486,21 @@ class VM(qtest.QEMUQtestMachine):
|
||||
self._args.append(opts)
|
||||
return self
|
||||
|
||||
def add_drive(self, path, opts='', interface='virtio', format=imgfmt):
|
||||
def add_drive(self, path, opts='', interface='virtio', img_format=imgfmt):
|
||||
'''Add a virtio-blk drive to the VM'''
|
||||
options = ['if=%s' % interface,
|
||||
'id=drive%d' % self._num_drives]
|
||||
|
||||
if path is not None:
|
||||
options.append('file=%s' % path)
|
||||
options.append('format=%s' % format)
|
||||
options.append('format=%s' % img_format)
|
||||
options.append('cache=%s' % cachemode)
|
||||
options.append('aio=%s' % aiomode)
|
||||
|
||||
if opts:
|
||||
options.append(opts)
|
||||
|
||||
if format == 'luks' and 'key-secret' not in opts:
|
||||
if img_format == 'luks' and 'key-secret' not in opts:
|
||||
# default luks support
|
||||
if luks_default_secret_object not in self._args:
|
||||
self.add_object(luks_default_secret_object)
|
||||
|
Loading…
Reference in New Issue
Block a user