[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 37/38] iotests: More options for VM.add_drive()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v3 37/38] iotests: More options for VM.add_drive() |
Date: |
Wed, 3 Jun 2015 21:44:18 +0200 |
This patch allows specifying the interface to be used for the drive, and
makes specifying a path optional (if the path is None, the "file" option
will be omitted, thus creating an empty drive).
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
tests/qemu-iotests/iotests.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 04a294d..d991d2f 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -117,13 +117,16 @@ class VM(object):
self._args.append('-monitor')
self._args.append(args)
- def add_drive(self, path, opts=''):
+ def add_drive(self, path, opts='', interface='virtio'):
'''Add a virtio-blk drive to the VM'''
- options = ['if=virtio',
+ options = ['if=%s' % interface,
'format=%s' % imgfmt,
'cache=%s' % cachemode,
- 'file=%s' % path,
'id=drive%d' % self._num_drives]
+
+ if path is not None:
+ options.append('file=%s' % path)
+
if opts:
options.append(opts)
--
2.4.1
- [Qemu-devel] [PATCH v3 29/38] blockdev: Add blockdev-insert-medium, (continued)
- [Qemu-devel] [PATCH v3 29/38] blockdev: Add blockdev-insert-medium, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 27/38] blockdev: Add blockdev-close-tray, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 30/38] blockdev: Implement eject with basic operations, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 31/38] blockdev: Implement change with basic operations, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 32/38] block: Inquire tray state before tray-moved events, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 34/38] hmp: Use blockdev-change-medium for change command, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 33/38] qmp: Introduce blockdev-change-medium, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 35/38] blockdev: read-only-mode for blockdev-change-medium, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 37/38] iotests: More options for VM.add_drive(),
Max Reitz <=
- [Qemu-devel] [PATCH v3 36/38] hmp: Add read-only-mode option to change command, Max Reitz, 2015/06/03
- [Qemu-devel] [PATCH v3 38/38] iotests: Add test for change-related QMP commands, Max Reitz, 2015/06/03