| Summary: | qemu-kvm fails to deal with invalid -smp option properly | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Shaolong Hu <shu> |
| Component: | qemu-kvm | Assignee: | Eduardo Habkost <ehabkost> |
| Status: | CLOSED NEXTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.0 | CC: | acathrow, areis, chayang, juzhang, michen, mkenneth, virt-maint, xutian |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-07-24 20:46:04 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Shaolong Hu
2011-10-11 09:38:01 UTC
An update with qemu-kvm-0.12.1.2-2.196.el6.x86_64: -smp dd,cores=2,dd,sockets=2,threads=2 (qemu) info cpus * CPU #0: pc=0x00000000000c945c (halted) thread_id=13833 CPU #1: pc=0x00000000000ff0a2 (halted) thread_id=13834 -smp dd,cores=2,sockets=2,threads=2 (qemu) info cpus * CPU #0: pc=0x00000000000fe4ee thread_id=13798 CPU #1: pc=0x00000000000ff0a2 (halted) thread_id=13799 CPU #2: pc=0x00000000000ff0a2 (halted) thread_id=13800 CPU #3: pc=0x00000000000ff0a2 (halted) thread_id=13801 (In reply to comment #1) > An update with qemu-kvm-0.12.1.2-2.196.el6.x86_64: > -smp dd,cores=2,dd,sockets=2,threads=2 > (qemu) info cpus > * CPU #0: pc=0x00000000000c945c (halted) thread_id=13833 > CPU #1: pc=0x00000000000ff0a2 (halted) thread_id=13834 > -smp dd,cores=2,sockets=2,threads=2 > (qemu) info cpus > * CPU #0: pc=0x00000000000fe4ee thread_id=13798 > CPU #1: pc=0x00000000000ff0a2 (halted) thread_id=13799 > CPU #2: pc=0x00000000000ff0a2 (halted) thread_id=13800 > CPU #3: pc=0x00000000000ff0a2 (halted) thread_id=13801 Ok, seems there is no regular pattern. Discussed with Eduardo in PVT and we concluded this should be fixed in rhel-7 and not 6.3. Users are supposed to be using libvirt instead of qemu-kvm directly, so this is minor. *** Bug 852642 has been marked as a duplicate of this bug. *** (In reply to comment #4) > *** Bug 852642 has been marked as a duplicate of this bug. *** Interesting analysis from Markus Armbruster over there: """ Yes, parsing of -smp's argument is sloppy. Same upstream. -help claims number of CPUs is mandatory, but the code treats it as optional. Additional funnies: * -smp "" Since all parameters are optional, this has no effect * -smp 0 Code interprets 0 as "use default", and the default is 1. Same for all the named parameter values. * -smp 4294967296 Argument is silently truncated to int, in this case to zero. * -smp 1,sockets= Named parameter with empty value is silently ignored. * -smp 1,sockets=maybe Named parameter value is parsed just as sloppily as the number of CPUs, in this case as zero. * -smp 1,silly -smp 1,qemu=moron Unknown parameters are silently ignored. """ Upstream fix is:
commit 12b7f57e2cfcd665cf5a21b4ae3c23b9361c5c05
Author: Michael Tokarev <mjt.ru>
Date: Mon Jun 24 15:06:52 2013 +0400
vl: convert -smp to qemu_opts_parse()
This also introduces a new suboption, "cpus=",
which is the default. So after this patch,
-smp n,sockets=y
is the same as
-smp cpus=n,sockets=y
(with "cpu" being some generic thing, referring to
either cores, or threads, or sockets, as before).
We still don't validate relations between different
numbers, for example it is still possible to say
-smp 1,sockets=10
and it will be accepted to mean sockets=1.
Signed-off-by: Michael Tokarev <mjt.ru>
Message-id: 1372072012-30305-1-git-send-email-mjt.msk.ru
Signed-off-by: Anthony Liguori <aliguori.com>
|