[libvirt] [PATCH] qemu: Add more defaults for RISC-V virt guests

Andrea Bolognani posted 1 patch 5 years, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20180828155625.17801-1-abologna@redhat.com
Test syntax-check passed
src/qemu/qemu_domain.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
[libvirt] [PATCH] qemu: Add more defaults for RISC-V virt guests
Posted by Andrea Bolognani 5 years, 7 months ago
We would have used virtio for networking anyway, but it's
better to be explicit; for graphics, none of the existing
models work right now but virtio is the only one which
has a non-PCI variant, so it's as good a default as any.

Spotted-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 src/qemu/qemu_domain.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 22c6d8f090..2410add9c2 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5840,6 +5840,10 @@ qemuDomainDefaultNetModel(const virDomainDef *def,
         return "lan9118";
     }
 
+    /* virtio is a sensible default for RISC-V virt guests */
+    if (qemuDomainIsRISCVVirt(def))
+        return "virtio";
+
     /* In all other cases the model depends on the capabilities. If they were
      * not provided don't report any default. */
     if (!qemuCaps)
@@ -6326,7 +6330,9 @@ qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video,
     if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) {
         if (ARCH_IS_PPC64(def->os.arch))
             video->type = VIR_DOMAIN_VIDEO_TYPE_VGA;
-        else if (qemuDomainIsARMVirt(def) || ARCH_IS_S390(def->os.arch))
+        else if (qemuDomainIsARMVirt(def) ||
+                 qemuDomainIsRISCVVirt(def) ||
+                 ARCH_IS_S390(def->os.arch))
             video->type = VIR_DOMAIN_VIDEO_TYPE_VIRTIO;
         else
             video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Add more defaults for RISC-V virt guests
Posted by Ján Tomko 5 years, 7 months ago
On Tue, Aug 28, 2018 at 05:56:25PM +0200, Andrea Bolognani wrote:
>We would have used virtio for networking anyway, but it's
>better to be explicit; for graphics, none of the existing
>models work right now but virtio is the only one which
>has a non-PCI variant, so it's as good a default as any.
>
>Spotted-by: Ján Tomko <jtomko@redhat.com>
>Signed-off-by: Andrea Bolognani <abologna@redhat.com>
>---
> src/qemu/qemu_domain.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list