[libvirt] Examples of QEMU machine-type-specific code in libvirt?

Eduardo Habkost ehabkost at redhat.com
Wed Aug 3 20:49:13 UTC 2016


Hi,

I am collecting some material for my KVM Forum talk, and I am
interested in hearing from libvirt developers about instances
where machine-type-specific information is needed by libvirt, and
the info is not provided by QEMU.

I found some instances where machine-type capabilities are
hardcoded in libvirt itself (see below[1]), but I would like to
know if you have other examples. They may be about things that
are already done by libvirt today, or about things that you would
like to do in the future.

[1] Examples where machine-type names are hardcoded in libvirt:

src/qemu/qemu_capabilities.c:            STREQ(def->os.machine, "ppce500"))
src/qemu/qemu_capabilities.c:            STREQ(def->os.machine, "prep"))
src/qemu/qemu_capabilities.c:            STREQ(def->os.machine, "bamboo"))
src/qemu/qemu_capabilities.c:        if (STREQ(def->os.machine, "mpc8544ds"))
src/qemu/qemu_capabilities.c:        if (STREQ(machines[i]->name, "none"))
src/qemu/qemu_capabilities.c:        STREQ(def->os.machine, "isapc");
src/qemu/qemu_capabilities.c:        (STRNEQ(machine, "pseries") && !STRPREFIX(machine, "pseries-")))
src/qemu/qemu_capabilities.c:        (STRNEQ(machine, "pseries") && !STRPREFIX(machine, "pseries-")))
src/qemu/qemu_capabilities.c:    if (STRNEQ(domCaps->machine, "virt") &&
src/qemu/qemu_capabilities.c:        !STRPREFIX(domCaps->machine, "virt-"))
src/qemu/qemu_command.c:    if (STRPREFIX(def->os.machine, "s390-virtio") &&
src/qemu/qemu_domain.c:        if (STREQ(def->os.machine, "isapc")) {
src/qemu/qemu_domain.c:        if (STREQ(def->os.machine, "versatilepb"))
src/qemu/qemu_domain.c:    return (STRPREFIX(def->os.machine, "pc-q35") ||
src/qemu/qemu_domain.c:            STREQ(def->os.machine, "q35"));
src/qemu/qemu_domain.c:    return (STREQ(def->os.machine, "pc") ||
src/qemu/qemu_domain.c:            STRPREFIX(def->os.machine, "pc-0.") ||
src/qemu/qemu_domain.c:            STRPREFIX(def->os.machine, "pc-1.") ||
src/qemu/qemu_domain.c:            STRPREFIX(def->os.machine, "pc-i440") ||
src/qemu/qemu_domain.c:            STRPREFIX(def->os.machine, "rhel"));
src/qemu/qemu_domain.c:    char *p = STRSKIP(def->os.machine, "pc-q35-");
src/qemu/qemu_domain.c:    return STRPREFIX(def->os.machine, "s390-ccw");
src/qemu/qemu_domain.c:    if (STRNEQ(def->os.machine, "virt") &&
src/qemu/qemu_domain.c:        !STRPREFIX(def->os.machine, "virt-"))
src/qemu/qemu_domain.c:    if (STRNEQ(def->os.machine, "pseries") &&
src/qemu/qemu_domain.c:        !STRPREFIX(def->os.machine, "pseries-"))
src/qemu/qemu_domain.c:        STREQ(def->os.machine, "malta") ||
src/qemu/qemu_domain.c:        STREQ(def->os.machine, "sun4u") ||
src/qemu/qemu_domain.c:        STREQ(def->os.machine, "g3beige");
src/qemu/qemu_domain_address.c:    if (!(STRPREFIX(def->os.machine, "vexpress-") ||
src/qemu/qemu_domain_address.c:    if (STREQ(def->os.machine, "versatilepb"))


-- 
Eduardo




More information about the libvir-list mailing list