]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: do not use domain virt type to get default version
authorLiang Yan <lyan@digitalocean.com>
Tue, 26 Apr 2022 20:38:26 +0000 (16:38 -0400)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 4 May 2022 10:02:32 +0000 (12:02 +0200)
We do not need VIR_DOMAIN_VIRT_QEMU to get qemu default
version. With the 'os_type' and 'arch'in capabilities,
we could identify 'emulator' which is enough to get the version.

Actually VIR_DOMAIN_VIRT_QEMU is not the only domain virt type for
qemu driver, there are VIR_DOMAIN_VIRT_KVM and VIR_DOMAIN_VIRT_HVF.
If TCG is disabled in qemu, it will cause the error that could not
find suitable emulater when access version.

Signed-off-by: Liang Yan <lyan@digtalocean.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_capabilities.c

index b91db851bb7763df8f605f0a16bcb126dd6b522c..9a0b7ebeb4d6f5176963437db0d487c83fc7282d 100644 (file)
@@ -1857,7 +1857,7 @@ int virQEMUCapsGetDefaultVersion(virCaps *caps,
 
     hostarch = virArchFromHost();
     if (!(capsdata = virCapabilitiesDomainDataLookup(caps,
-            VIR_DOMAIN_OSTYPE_HVM, hostarch, VIR_DOMAIN_VIRT_QEMU,
+            VIR_DOMAIN_OSTYPE_HVM, hostarch, VIR_DOMAIN_VIRT_NONE,
             NULL, NULL))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Cannot find suitable emulator for %s"),