[PATCH v2 06/17] qemu: Use virtio-scsi by default on RISC-V

Andrea Bolognani posted 17 patches 11 months ago
[PATCH v2 06/17] qemu: Use virtio-scsi by default on RISC-V
Posted by Andrea Bolognani 11 months 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                                |  4 +++-
 ...virt-default-models.riscv64-latest.abi-update.args |  5 +++--
 ...-virt-default-models.riscv64-latest.abi-update.xml | 11 ++++++++---
 .../riscv64-virt-default-models.riscv64-latest.args   |  5 +++--
 .../riscv64-virt-default-models.riscv64-latest.xml    | 11 ++++++++---
 5 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f4af8fb6ba..31d634b151 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4107,8 +4107,10 @@ qemuDomainDefaultSCSIControllerModelInternal(const virDomainDef *def,
         return VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90;
 
     /* 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;
+    }
 
     /* pSeries has its own special default */
     if (qemuDomainIsPSeries(def))
diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args
index 28b56d876c..7990f7f6a0 100644
--- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args
+++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args
@@ -30,13 +30,14 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
 -device '{"driver":"pcie-pci-bridge","id":"pci.3","bus":"pci.1","addr":"0x0"}' \
 -device '{"driver":"pcie-root-port","port":10,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x2"}' \
 -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":"piix3-usb-uhci","id":"usb","bus":"pci.3","addr":"0x1"}' \
--device '{"driver":"lsi","id":"scsi0","bus":"pci.3","addr":"0x2"}' \
+-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.4","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"}' \
 -chardev pty,id=charserial0 \
 -serial chardev:charserial0 \
 -audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.4","addr":"0x0"}' \
+-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.5","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.abi-update.xml b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml
index 942bd21f9e..72dc447d33 100644
--- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml
+++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml
@@ -17,8 +17,8 @@
     <controller type='usb' index='0' model='piix3-uhci'>
       <address type='pci' domain='0x0000' bus='0x03' slot='0x01' function='0x0'/>
     </controller>
-    <controller type='scsi' index='0' model='lsilogic'>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x02' function='0x0'/>
+    <controller type='scsi' index='0' model='virtio-scsi'>
+      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
     </controller>
     <controller type='pci' index='0' model='pcie-root'/>
     <controller type='pci' index='1' model='pcie-root-port'>
@@ -45,6 +45,11 @@
       <target chassis='5' port='0xb'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
     </controller>
+    <controller type='pci' index='6' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='6' 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'/>
@@ -61,7 +66,7 @@
     <audio id='1' type='none'/>
     <video>
       <model type='virtio' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
     </video>
     <memballoon model='none'/>
   </devices>
diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args
index 28b56d876c..7990f7f6a0 100644
--- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args
+++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args
@@ -30,13 +30,14 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
 -device '{"driver":"pcie-pci-bridge","id":"pci.3","bus":"pci.1","addr":"0x0"}' \
 -device '{"driver":"pcie-root-port","port":10,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x2"}' \
 -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":"piix3-usb-uhci","id":"usb","bus":"pci.3","addr":"0x1"}' \
--device '{"driver":"lsi","id":"scsi0","bus":"pci.3","addr":"0x2"}' \
+-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.4","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"}' \
 -chardev pty,id=charserial0 \
 -serial chardev:charserial0 \
 -audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.4","addr":"0x0"}' \
+-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.5","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 942bd21f9e..72dc447d33 100644
--- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml
+++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml
@@ -17,8 +17,8 @@
     <controller type='usb' index='0' model='piix3-uhci'>
       <address type='pci' domain='0x0000' bus='0x03' slot='0x01' function='0x0'/>
     </controller>
-    <controller type='scsi' index='0' model='lsilogic'>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x02' function='0x0'/>
+    <controller type='scsi' index='0' model='virtio-scsi'>
+      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
     </controller>
     <controller type='pci' index='0' model='pcie-root'/>
     <controller type='pci' index='1' model='pcie-root-port'>
@@ -45,6 +45,11 @@
       <target chassis='5' port='0xb'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
     </controller>
+    <controller type='pci' index='6' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='6' 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'/>
@@ -61,7 +66,7 @@
     <audio id='1' type='none'/>
     <video>
       <model type='virtio' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x05' 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 v2 06/17] qemu: Use virtio-scsi by default on RISC-V
Posted by Peter Krempa 11 months ago
On Wed, Feb 14, 2024 at 18:11:13 +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                                |  4 +++-
>  ...virt-default-models.riscv64-latest.abi-update.args |  5 +++--
>  ...-virt-default-models.riscv64-latest.abi-update.xml | 11 ++++++++---
>  .../riscv64-virt-default-models.riscv64-latest.args   |  5 +++--
>  .../riscv64-virt-default-models.riscv64-latest.xml    | 11 ++++++++---
>  5 files changed, 25 insertions(+), 11 deletions(-)

So this is a rather important change. You should note it at least in the
release news. It might be worth even add a note to the XML definition
documentation, or at least the qemu driver specific page.

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
Re: [PATCH v2 06/17] qemu: Use virtio-scsi by default on RISC-V
Posted by Andrea Bolognani 11 months ago
On Thu, Feb 15, 2024 at 02:02:25PM +0100, Peter Krempa wrote:
> On Wed, Feb 14, 2024 at 18:11:13 +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                                |  4 +++-
> >  ...virt-default-models.riscv64-latest.abi-update.args |  5 +++--
> >  ...-virt-default-models.riscv64-latest.abi-update.xml | 11 ++++++++---
> >  .../riscv64-virt-default-models.riscv64-latest.args   |  5 +++--
> >  .../riscv64-virt-default-models.riscv64-latest.xml    | 11 ++++++++---
> >  5 files changed, 25 insertions(+), 11 deletions(-)
>
> So this is a rather important change. You should note it at least in the
> release news.

Strongly agreed. I'll be sure to handle that.

> It might be worth even add a note to the XML definition
> documentation, or at least the qemu driver specific page.

Not sure about this. We don't seem to explicitly document most of the
existing defaults, so I wouldn't even know where a change in defaults
could possibly fit in.

I think I'd skip this part, if that's okay with you.

-- 
Andrea Bolognani / Red Hat / Virtualization
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH v2 06/17] qemu: Use virtio-scsi by default on RISC-V
Posted by Peter Krempa 11 months ago
On Thu, Feb 15, 2024 at 05:54:58 -0800, Andrea Bolognani wrote:
> On Thu, Feb 15, 2024 at 02:02:25PM +0100, Peter Krempa wrote:
> > On Wed, Feb 14, 2024 at 18:11:13 +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                                |  4 +++-
> > >  ...virt-default-models.riscv64-latest.abi-update.args |  5 +++--
> > >  ...-virt-default-models.riscv64-latest.abi-update.xml | 11 ++++++++---
> > >  .../riscv64-virt-default-models.riscv64-latest.args   |  5 +++--
> > >  .../riscv64-virt-default-models.riscv64-latest.xml    | 11 ++++++++---
> > >  5 files changed, 25 insertions(+), 11 deletions(-)
> >
> > So this is a rather important change. You should note it at least in the
> > release news.
> 
> Strongly agreed. I'll be sure to handle that.
> 
> > It might be worth even add a note to the XML definition
> > documentation, or at least the qemu driver specific page.
> 
> Not sure about this. We don't seem to explicitly document most of the
> existing defaults, so I wouldn't even know where a change in defaults
> could possibly fit in.
> 
> I think I'd skip this part, if that's okay with you.

I'm okay with not adding it to 'formatdomain.rst' but IMO a section in
'drvqemu.rst' outlining these changes would make sense as it's driver
specific.
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org