Bug 852642 - qemu process should exit when a invaild value set for "-smp"
qemu process should exit when a invaild value set for "-smp"
Status: CLOSED DUPLICATE of bug 745047
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.4
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Markus Armbruster
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-29 04:11 EDT by xu
Modified: 2012-09-07 16:29 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-07 16:29:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description xu 2012-08-29 04:11:19 EDT
Description of problem:

A guest can start up by command "qemu-kvm -smp a,cores=0 -hda /tmp/test.qcow2" , but as we know values of "smp","cores","sockets","threads" and "maxcpus" should be an integer greater than zero;
although, qemu-kvm has instead the invaild values to "1" and startup the guest, and in fact the value of "-smp" option is a invaid value;

And I found "-m" not speicaled , system will use a default value , but if a invaild setted, qemu will exit with error message;
[root@localhost ~]# qemu-kvm -m a
qemu: invalid ram size: a

I hope "-smp" option do same action like "-m" do;

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. create a image with : qemu-img create -f qcow2  /tmp/test.qcow2 1G
2. boot up guest with a invaild value "a" set to -smp option
  
Actual results:

guest boot up without any warning or error messgae about invaid value detected

Expected results:

qemu exit and with error message print out

Additional info:
Comment 1 Markus Armbruster 2012-09-07 06:19:14 EDT
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.
Comment 2 Ademar Reis 2012-09-07 16:29:05 EDT

*** This bug has been marked as a duplicate of bug 745047 ***

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