tests/vm: Extract the kvm_available() handy function

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181013004034.6968-2-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2018-10-13 02:40:26 +02:00 committed by Fam Zheng
parent 1578466c9a
commit b59b82eded
2 changed files with 6 additions and 2 deletions

View file

@ -26,6 +26,10 @@ import tempfile
LOG = logging.getLogger(__name__)
def kvm_available(target_arch=None):
return os.access("/dev/kvm", os.R_OK | os.W_OK)
#: Maps machine types to the preferred console device types
CONSOLE_DEV_TYPES = {
r'^clipper$': 'isa-serial',