Currently we only probe the main qemu binary for machine types, but we should also probe the kvm binary. * src/qemu_conf.c: probe kvm binary machines in qemudCapsInitGuest() --- src/qemu_conf.c | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/qemu_conf.c b/src/qemu_conf.c index 0d498c2..ddf7348 100644 --- a/src/qemu_conf.c +++ b/src/qemu_conf.c @@ -710,14 +710,48 @@ qemudCapsInitGuest(virCapsPtr caps, NULL) == NULL) return -1; - if (haskvm && - virCapabilitiesAddGuestDomain(guest, - "kvm", - kvmbin, - NULL, - 0, - NULL) == NULL) - return -1; + if (haskvm) { + virCapsGuestDomainPtr dom; + + if (stat(kvmbin, &st) == 0) { + binary_mtime = st.st_mtime; + } else { + char ebuf[1024]; + VIR_WARN(_("Failed to stat %s, most peculiar : %s"), + binary, virStrerror(errno, ebuf, sizeof(ebuf))); + binary_mtime = 0; + } + + machines = NULL; + nmachines = 0; + + if (!STREQ(binary, kvmbin)) { + int probe = 1; + if (old_caps && binary_mtime) + probe = !qemudGetOldMachines("hvm", info->arch, info->wordsize, + kvmbin, binary_mtime, + old_caps, &machines, &nmachines); + if (probe && + qemudProbeMachineTypes(kvmbin, &machines, &nmachines) < 0) + return -1; + } + + if ((dom = virCapabilitiesAddGuestDomain(guest, + "kvm", + kvmbin, + NULL, + nmachines, + machines)) == NULL) { + for (i = 0; i < nmachines; i++) { + VIR_FREE(machines[i]->name); + VIR_FREE(machines[i]); + } + VIR_FREE(machines); + return -1; + } + + dom->info.emulator_mtime = binary_mtime; + } } else { if (virCapabilitiesAddGuestDomain(guest, "kvm", -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list