[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/5] tests/vm: Extract the kvm_available() handy fun
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 1/5] tests/vm: Extract the kvm_available() handy function |
Date: |
Mon, 16 Jul 2018 23:48:23 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
tests/vm/basevm.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 3643117816..04089cd545 100755
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -33,6 +33,11 @@ SSH_KEY = open(os.path.join(os.path.dirname(__file__),
SSH_PUB_KEY = open(os.path.join(os.path.dirname(__file__),
"..", "keys", "id_rsa.pub")).read()
+
+def kvm_available():
+ return os.access("/dev/kvm", os.R_OK | os.W_OK)
+
+
class BaseVM(object):
GUEST_USER = "qemu"
GUEST_PASS = "qemupass"
@@ -72,7 +77,7 @@ class BaseVM(object):
"-serial", "file:%s" % os.path.join(self._tmpdir, "serial.out")]
if vcpus:
self._args += ["-smp", str(vcpus)]
- if os.access("/dev/kvm", os.R_OK | os.W_OK):
+ if kvm_available():
self._args += ["-enable-kvm"]
else:
logging.info("KVM not available, not using -enable-kvm")
--
2.18.0
- [Qemu-devel] [PATCH 0/5] tests/vm: Improvements when KVM is not available, Philippe Mathieu-Daudé, 2018/07/16
- [Qemu-devel] [PATCH 1/5] tests/vm: Extract the kvm_available() handy function,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 2/5] tests/vm: Use 'host' cpu when KVM is available, else default to 'max', Philippe Mathieu-Daudé, 2018/07/16
- [Qemu-devel] [PATCH 3/5] tests/vm: Do not abuse parallelism when KVM is not available, Philippe Mathieu-Daudé, 2018/07/16
- [Qemu-devel] [RFC PATCH 4/5] tests/vm: Display remaining seconds to wait for a VM to start, Philippe Mathieu-Daudé, 2018/07/16
- [Qemu-devel] [RFC PATCH 5/5] tests/vm: When using TCG, wait longer for a VM to start, Philippe Mathieu-Daudé, 2018/07/16