All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Jeff Cody <jcody@redhat.com>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH v2 1/4] iotests: More options for VM.add_drive()
Date: Wed,  2 Sep 2015 20:52:25 +0200	[thread overview]
Message-ID: <1441219948-13242-2-git-send-email-mreitz@redhat.com> (raw)
In-Reply-To: <1441219948-13242-1-git-send-email-mreitz@redhat.com>

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 <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 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 5579253..1f913a1 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -118,13 +118,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.5.1

  reply	other threads:[~2015-09-02 18:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 18:52 [Qemu-devel] [PATCH v2 0/4] iotests: Emit signal-kill messages Max Reitz
2015-09-02 18:52 ` Max Reitz [this message]
2015-09-02 18:52 ` [Qemu-devel] [PATCH v2 2/4] iotests: Respect -nodefaults in tests 41 and 55 Max Reitz
2015-09-02 19:55   ` Eric Blake
2015-09-02 18:52 ` [Qemu-devel] [PATCH v2 3/4] iotests: Do not suppress segfaults in bash tests Max Reitz
2015-09-02 20:02   ` Eric Blake
2015-09-02 18:52 ` [Qemu-devel] [PATCH v2 4/4] iotests: Warn if python subprocess is killed Max Reitz
2015-09-02 20:17   ` Eric Blake
2015-09-03 15:25 ` [Qemu-devel] [PATCH v2 0/4] iotests: Emit signal-kill messages Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441219948-13242-2-git-send-email-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.