From a6fa81ba23c2bf4d7d3e1b5fb0ef3b10bcfaaa54 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Thu, 4 Apr 2019 12:49:45 +0200 Subject: [PATCH] guest: Recommend virt machine for RISC-V The default machine at the QEMU level is spike_v1.10, but most people will really want to use the virt machine type instead. Reviewed-by: Cole Robinson Signed-off-by: Andrea Bolognani --- tests/cli-test-xml/compare/virt-install-riscv64-graphics.xml | 2 +- tests/cli-test-xml/compare/virt-install-riscv64-headless.xml | 2 +- virtinst/guest.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/cli-test-xml/compare/virt-install-riscv64-graphics.xml b/tests/cli-test-xml/compare/virt-install-riscv64-graphics.xml index 8a9f7a732..ff7324a96 100644 --- a/tests/cli-test-xml/compare/virt-install-riscv64-graphics.xml +++ b/tests/cli-test-xml/compare/virt-install-riscv64-graphics.xml @@ -10,7 +10,7 @@ 65536 1 - hvm + hvm diff --git a/tests/cli-test-xml/compare/virt-install-riscv64-headless.xml b/tests/cli-test-xml/compare/virt-install-riscv64-headless.xml index 663081c96..ef0ffb883 100644 --- a/tests/cli-test-xml/compare/virt-install-riscv64-headless.xml +++ b/tests/cli-test-xml/compare/virt-install-riscv64-headless.xml @@ -10,7 +10,7 @@ 65536 1 - hvm + hvm diff --git a/virtinst/guest.py b/virtinst/guest.py index 0538ccfd1..254aaa58b 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -129,6 +129,10 @@ class Guest(XMLBuilder): if "s390-ccw-virtio" in capsinfo.machines: return "s390-ccw-virtio" + if capsinfo.arch in ["riscv64", "riscv32"]: + if "virt" in capsinfo.machines: + return "virt" + if capsinfo.conn.is_qemu() or capsinfo.conn.is_test(): return _qemu_machine() return None