diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 168e7464a9655a8b116161016d46e7faa7ea6d41..4a6975e285e86ce69bec22ee4b37a0215bccdd79 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7880,20 +7880,26 @@ qemuDomainDeviceNetDefPostParse(virDomainNetDefPtr net, } +static int +qemuDomainDefaultVideoDevice(const virDomainDef *def) +{ + if (ARCH_IS_PPC64(def->os.arch)) + return VIR_DOMAIN_VIDEO_TYPE_VGA; + else if (qemuDomainIsARMVirt(def) || + qemuDomainIsRISCVVirt(def) || + ARCH_IS_S390(def->os.arch)) + return VIR_DOMAIN_VIDEO_TYPE_VIRTIO; + else + return VIR_DOMAIN_VIDEO_TYPE_CIRRUS; +} + + static int qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video, const virDomainDef *def) { - 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) || - qemuDomainIsRISCVVirt(def) || - ARCH_IS_S390(def->os.arch)) - video->type = VIR_DOMAIN_VIDEO_TYPE_VIRTIO; - else - video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS; - } + if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) + video->type = qemuDomainDefaultVideoDevice(def); if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && !video->vgamem) {