Skip to contentSkip to conversation

vl: convert -smp to qemu_opts_parse()

PATCH Applied Michael Tokarev 2 participants 2 messages Jun 24, 2013 – Jul 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 qemu-options.hx |    4 +-
 vl.c            |  122 +++++++++++++++++++++++++++++++------------------------
 2 files changed, 71 insertions(+), 55 deletions(-)
qemu-options.hx +2 -2
index 8355f9b..982e312 100644
@@ -73,7 +73,7 @@ Select CPU model (@code{-cpu help} for list and additional feature selection)
 ETEXI
 
 DEF("smp", HAS_ARG, QEMU_OPTION_smp,
-    "-smp n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n"
+    "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n"
     "                set the number of CPUs to 'n' [default=1]\n"
     "                maxcpus= maximum number of total cpus, including\n"
     "                offline CPUs for hotplug, etc\n"
@@ -82,7 +82,7 @@ DEF("smp", HAS_ARG, QEMU_OPTION_smp,
     "                sockets= number of discrete sockets in the system\n",
         QEMU_ARCH_ALL)
 STEXI
-@item -smp @var{n}[,cores=@var{cores}][,threads=@var{threads}][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}]
+@item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}]
 @findex -smp
 Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255
 CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
vl.c +69 -53

153 lines not on this page · raw message

Signature · 1 line
1.7.10.4