]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Report all supported machine types in capabilities
authorJiri Denemark <jdenemar@redhat.com>
Fri, 12 Jun 2015 12:36:51 +0000 (14:36 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 18 Jun 2015 07:49:33 +0000 (09:49 +0200)
commitbeca509e437b51b68ff42494cc67919d306876ea
tree7b89753e8b00508284be53c9e2d85e12bf9d3fb5
parent7690a5a8383216ed0d85125b442f625ac8a2ee62
qemu: Report all supported machine types in capabilities

Some machine types are only reported as canonical names for other
machine types, which make it a bit harder to find what machine types are
supported by a specific QEMU binary. Ideally, one would just use
/capabilities/guest/arch[@name='...']/machine/text() XPath to get a list
of all supported machine types, but it doesn't work right now.

For example, we report

    <machine canonical='pc-i440fx-2.3' maxCpus='255'>pc</machine>

in guest capabilities, but the corresponding

    <machine maxCpus='255'>pc-i440fx-2.3</machine>

is missing.

This is a result of QMP probing. With "-machine ?" parsing QEMU sends
us two lines:

pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.3)
pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996) (default)

while query-machines QMP command reports both in the same entry:

{"name": "pc-i440fx-2.3", "is-default": true, "cpu-max": 255, "alias": "pc"}

Let's make sure we always report separate <machine/> for both the
canonical name and its alias and using the canonical name as the default
machine type (i.e., inserting it before its alias) in case is-default is
true.

https://bugzilla.redhat.com/show_bug.cgi?id=1229666

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_capabilities.c