Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 725269 - generated qemu -smp string is ambiguous, gives unexpected results
generated qemu -smp string is ambiguous, gives unexpected results
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.2
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Martin Kletzander
Virtualization Bugs
:
: 725271 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-24 18:37 EDT by Cole Robinson
Modified: 2012-06-20 02:29 EDT (History)
6 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
No Documentation needed
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:29:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 15:31:38 EDT

  None (edit)
Description Cole Robinson 2011-07-24 18:37:14 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
Comment 3 Dave Allan 2011-11-23 15:25:26 EST
*** Bug 725271 has been marked as a duplicate of this bug. ***
Comment 4 Martin Kletzander 2012-01-13 08:23:46 EST
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.
Comment 8 min zhan 2012-02-15 01:55:36 EST
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
Comment 9 Martin Kletzander 2012-05-03 09:12:56 EDT
    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
Comment 11 errata-xmlrpc 2012-06-20 02:29:24 EDT
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

Note You need to log in before you can comment on or make changes to this bug.