[PATCH 33/33] qemu: Use virtio-scsi by default on RISC-V

Andrea Bolognani posted 33 patches 9 months, 2 weeks ago
There is a newer version of this series
[PATCH 33/33] qemu: Use virtio-scsi by default on RISC-V
Posted by Andrea Bolognani 9 months, 2 weeks ago
Just like piix3-uhci for USB, the choice of lsilogic for SCSI
was dictated entirely by that being the default for legacy x86
guests. Use virtio-scsi instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 src/qemu/qemu_domain.c                        |  3 ++-
 ...64-virt-default-models.riscv64-latest.args | 13 +++++------
 ...v64-virt-default-models.riscv64-latest.xml | 22 ++++++++-----------
 3 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index bc83052920..138cf08b37 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4133,7 +4133,8 @@ qemuDomainDefaultSCSIControllerModel(const virDomainDef *def,
         return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI;
 
     /* Most new architectures should ideally use virtio */
-    if (ARCH_IS_S390(def->os.arch))
+    if (ARCH_IS_S390(def->os.arch) ||
+        qemuDomainIsRISCVVirt(def))
         return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI;
 
     /* If there is no preference, base the choice on device
diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args
index 3a5cceb5e7..155c5aed9c 100644
--- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args
+++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args
@@ -28,16 +28,15 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
 -device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \
 -device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \
 -device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x2"}' \
--device '{"driver":"pcie-pci-bridge","id":"pci.4","bus":"pci.1","addr":"0x0"}' \
--device '{"driver":"pcie-root-port","port":11,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x3"}' \
--device '{"driver":"pcie-root-port","port":12,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x1.0x4"}' \
--device '{"driver":"qemu-xhci","id":"usb","bus":"pci.3","addr":"0x0"}' \
--device '{"driver":"lsi","id":"scsi0","bus":"pci.4","addr":"0x1"}' \
+-device '{"driver":"pcie-root-port","port":11,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x3"}' \
+-device '{"driver":"pcie-root-port","port":12,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x4"}' \
+-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.2","addr":"0x0"}' \
+-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.3","addr":"0x0"}' \
 -netdev '{"type":"user","id":"hostnet0"}' \
--device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.2","addr":"0x0"}' \
+-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \
 -chardev pty,id=charserial0 \
 -serial chardev:charserial0 \
 -audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.5","addr":"0x0"}' \
+-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.4","addr":"0x0"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml
index 896bd7d0f0..4628cd7895 100644
--- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml
+++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml
@@ -15,10 +15,10 @@
   <devices>
     <emulator>/usr/bin/qemu-system-riscv64</emulator>
     <controller type='usb' index='0' model='qemu-xhci'>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
     </controller>
-    <controller type='scsi' index='0' model='lsilogic'>
-      <address type='pci' domain='0x0000' bus='0x04' slot='0x01' function='0x0'/>
+    <controller type='scsi' index='0' model='virtio-scsi'>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
     </controller>
     <controller type='pci' index='0' model='pcie-root'/>
     <controller type='pci' index='1' model='pcie-root-port'>
@@ -36,24 +36,20 @@
       <target chassis='3' port='0xa'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
-    <controller type='pci' index='4' model='pcie-to-pci-bridge'>
-      <model name='pcie-pci-bridge'/>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
-    </controller>
-    <controller type='pci' index='5' model='pcie-root-port'>
+    <controller type='pci' index='4' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='5' port='0xb'/>
+      <target chassis='4' port='0xb'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
     </controller>
-    <controller type='pci' index='6' model='pcie-root-port'>
+    <controller type='pci' index='5' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='6' port='0xc'/>
+      <target chassis='5' port='0xc'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/>
     </controller>
     <interface type='user'>
       <mac address='52:54:00:09:a4:37'/>
       <model type='virtio'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
     </interface>
     <serial type='pty'>
       <target type='system-serial' port='0'>
@@ -66,7 +62,7 @@
     <audio id='1' type='none'/>
     <video>
       <model type='virtio' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
     </video>
     <memballoon model='none'/>
   </devices>
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH 33/33] qemu: Use virtio-scsi by default on RISC-V
Posted by Peter Krempa 9 months, 2 weeks ago
On Wed, Jan 24, 2024 at 20:37:53 +0100, Andrea Bolognani wrote:
> Just like piix3-uhci for USB, the choice of lsilogic for SCSI
> was dictated entirely by that being the default for legacy x86
> guests. Use virtio-scsi instead.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  src/qemu/qemu_domain.c                        |  3 ++-
>  ...64-virt-default-models.riscv64-latest.args | 13 +++++------
>  ...v64-virt-default-models.riscv64-latest.xml | 22 ++++++++-----------
>  3 files changed, 17 insertions(+), 21 deletions(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org