From: Cleber Rosa <crosa@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Max Reitz" <mreitz@redhat.com>,
qemu-block@nongnu.org, "Fam Zheng" <fam@euphon.net>,
"Cleber Rosa" <crosa@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] qemu-iotests: only enable kvm if the host seems to support it
Date: Fri, 8 Feb 2019 23:01:31 -0500 [thread overview]
Message-ID: <20190209040132.25573-2-crosa@redhat.com> (raw)
In-Reply-To: <20190209040132.25573-1-crosa@redhat.com>
There are certainly some improvements to be made with regards
to kvm capabilities detection, but this seems good enough for
this specific case.
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
tests/qemu-iotests/235 | 5 +++--
tests/qemu-iotests/238 | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/235 b/tests/qemu-iotests/235
index d6edd97ab4..c83b548adc 100755
--- a/tests/qemu-iotests/235
+++ b/tests/qemu-iotests/235
@@ -25,7 +25,7 @@ from iotests import qemu_img_create, qemu_io, file_path, log
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'scripts'))
-from qemu import QEMUMachine
+from qemu import QEMUMachine, kvm_available
# Note:
# This test was added to check that mirror dead-lock was fixed (see previous
@@ -49,7 +49,8 @@ qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocation=metadata', disk,
str(size))
vm = QEMUMachine(iotests.qemu_prog)
-vm.add_args('-machine', 'accel=kvm')
+if kvm_available():
+ vm.add_args('-machine', 'accel=kvm')
if iotests.qemu_default_machine == 's390-ccw-virtio':
vm.add_args('-no-shutdown')
vm.add_args('-drive', 'id=src,file=' + disk)
diff --git a/tests/qemu-iotests/238 b/tests/qemu-iotests/238
index f81ee1112f..75ccd5f82f 100755
--- a/tests/qemu-iotests/238
+++ b/tests/qemu-iotests/238
@@ -25,7 +25,7 @@ from iotests import log
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'scripts'))
-from qemu import QEMUMachine
+from qemu import QEMUMachine, kvm_available
if iotests.qemu_default_machine == 's390-ccw-virtio':
virtio_scsi_device = 'virtio-scsi-ccw'
@@ -33,7 +33,8 @@ else:
virtio_scsi_device = 'virtio-scsi-pci'
vm = QEMUMachine(iotests.qemu_prog)
-vm.add_args('-machine', 'accel=kvm')
+if kvm_available():
+ vm.add_args('-machine', 'accel=kvm')
vm.launch()
log(vm.qmp('blockdev-add', node_name='hd0', driver='null-co'))
--
2.20.1
next prev parent reply other threads:[~2019-02-09 4:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-09 4:01 [Qemu-devel] [PATCH 0/2] qemu-iotests: add a Travis job Cleber Rosa
2019-02-09 4:01 ` Cleber Rosa [this message]
2019-02-09 4:01 ` [Qemu-devel] [PATCH 2/2] qemu-iotests: add "make check-block" job to Travis Cleber Rosa
2019-02-18 18:05 ` [Qemu-devel] [PATCH 0/2] qemu-iotests: add a Travis job Cleber Rosa
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=20190209040132.25573-2-crosa@redhat.com \
--to=crosa@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=philmd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).