[virt-tools-list] [virt-manager PATCH 4/9] guest: Recommend virt machine for RISC-V

Andrea Bolognani abologna at redhat.com
Thu Apr 4 10:49:45 UTC 2019


The default machine at the QEMU level is spike_v1.10, but most
people will really want to use the virt machine type instead.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 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 8a9f7a73..ff7324a9 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 @@
   <currentMemory>65536</currentMemory>
   <vcpu>1</vcpu>
   <os>
-    <type arch="riscv64" machine="spike_v1.10">hvm</type>
+    <type arch="riscv64" machine="virt">hvm</type>
     <boot dev="hd"/>
   </os>
   <clock offset="utc"/>
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 663081c9..ef0ffb88 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 @@
   <currentMemory>65536</currentMemory>
   <vcpu>1</vcpu>
   <os>
-    <type arch="riscv64" machine="spike_v1.10">hvm</type>
+    <type arch="riscv64" machine="virt">hvm</type>
     <boot dev="hd"/>
   </os>
   <clock offset="utc"/>
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 0538ccfd..254aaa58 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
-- 
2.20.1




More information about the virt-tools-list mailing list