提交 6c5f6cda 编写于 作者: A Andrea Bolognani

qemu: Add more defaults for RISC-V virt guests

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: NJán Tomko <jtomko@redhat.com>
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 9610eaa4
...@@ -5847,6 +5847,10 @@ qemuDomainDefaultNetModel(const virDomainDef *def, ...@@ -5847,6 +5847,10 @@ qemuDomainDefaultNetModel(const virDomainDef *def,
return "lan9118"; 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 /* In all other cases the model depends on the capabilities. If they were
* not provided don't report any default. */ * not provided don't report any default. */
if (!qemuCaps) if (!qemuCaps)
...@@ -6337,7 +6341,9 @@ qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video, ...@@ -6337,7 +6341,9 @@ qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video,
if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) { if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) {
if (ARCH_IS_PPC64(def->os.arch)) if (ARCH_IS_PPC64(def->os.arch))
video->type = VIR_DOMAIN_VIDEO_TYPE_VGA; 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; video->type = VIR_DOMAIN_VIDEO_TYPE_VIRTIO;
else else
video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS; video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册