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 <crobinso@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Andrea Bolognani 2019-04-04 12:49:45 +02:00 committed by Cole Robinson
parent 955a3ee62e
commit a6fa81ba23
3 changed files with 6 additions and 2 deletions

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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