Red Hat Bugzilla – Bug 725269
generated qemu -smp string is ambiguous, gives unexpected results
Last modified: 2012-06-20 02:29:24 EDT
qemu -smp 1,sockets=1,cores=2,threads=1 doesn't give the expected 2 logical cpu, dual core socket result. see https://bugzilla.redhat.com/show_bug.cgi?id=725268 for more info. libvirt tickles this qemu weirdness by _always_ specifying the oldstyle -smp X value, even if topology is specified. What libvirt should be doing here is specifying _only_ topology info, provided qemu is new enough, otherwise use the oldstyle option, so it doesn't need to depend on how qemu interprets back compat options. Some background: https://bugzilla.redhat.com/show_bug.cgi?id=708892#c2
*** Bug 725271 has been marked as a duplicate of this bug. ***
According to the documentation, the number is not ambiguous. It specifies the current number of connected (enabled) vcpus, whether not specifying the number gives the maximum amount. QEmu's weirdness is, however, that specifying more than the maximum amount connectable to the specified topology doesn't generate any error nor warning. commit 5a89aaa9385248eceefcc982d73f063ba8232d9f Author: Martin Kletzander <mkletzan@redhat.com> Date: Thu Jan 12 10:45:35 2012 +0100 Added check for maximum number of vcpus exceeding topology limit Earlier, when the number of vcpus was greater than the topology allowed, libvirt didn't raise an error and continued, resulting in running qemu with parameters making no sense. Even though qemu did not report any error itself, the number of vcpus was set to maximum allowed by the topology.
Reproduce this bug with libvirt-0.9.9-2.el6 # virsh edit guest ... <vcpus>9</vcpus> <cpu> <topology sockets='2' cores='2' threads='2'/> </cpu> ... # ps -ef |grep kvm qemu 16700 1 29 05:34 ? 00:00:33 /usr/libexec/qemu-kvm -S -M rhel6.2.0 -enable-kvm -m 1024 -smp 9,sockets=2,cores=2,threads=2 -name rhel62 ...... Verified this bug with libvirt-0.9.10-1.el6 Steps: 1. virsh edit guest ... <vcpus>3</vcpus> <cpu> <topology sockets='2' cores='2' threads='2'/> </cpu> ... # ps -ef|grep kvm qemu 18014 1 10 05:47 ? 00:00:00 /usr/libexec/qemu-kvm -S -M rhel6.2.0 -enable-kvm -m 1024 -smp 3,sockets=2,cores=2,threads=2 -name rhel62 ... In which 3 < 2*2*2, guest can run successfully. 2. vcpu exceed the max allowed by topology, such as # virsh edit guest ... <vcpus>9</vcpus> <cpu> <topology sockets='2' cores='2' threads='2'/> </cpu> In which 9 > 2*2*2, when want to save the changes for the guest and quit, an error display for this cmd: # virsh edit rhel62 error: Maximum CPUs greater than topology limit
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: No Documentation needed
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0748.html