]> xenbits.xensource.com Git - libvirt.git/commit
qemu: command: rework adding of default cpu model
authorCole Robinson <crobinso@redhat.com>
Thu, 13 Jul 2017 14:39:13 +0000 (10:39 -0400)
committerCole Robinson <crobinso@redhat.com>
Thu, 3 Aug 2017 15:54:37 +0000 (11:54 -0400)
commit05583fcb37eae1ce7328491d15b3a02740769d47
tree46b12748baab4f4e8a2fe063d795b9b59bd30e28
parentb4f7793ce269ba163598c96c65761601556fb48b
qemu: command: rework adding of default cpu model

Certain XML features that aren't in the <cpu> block map to -cpu
flags on the qemu cli. If one of these is specified but the user
didn't explicitly pass an XML <cpu> model, we need to format a
default model on the command line.

The current code handles this by sprinkling this default cpu handling
among all the different flag string formatting. Instead, switch it
to do this just once.

This alters some test output slightly: the previous code would
write the default -cpu in some cases when no flags were actually
added, so the output was redundant.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/qemuxml2argv-hyperv-off.args
tests/qemuxml2argvdata/qemuxml2argv-kvm-features-off.args