extend -smp parsing to include cores= and threads= options

For injecting multi-core and multi-threading CPU topology into guests
extend the -smp syntax to accommodate cores and threads specification.
Syntax: -smp smp_value[,cores=nr_cores][,threads=nr_threads]\
[,socket=nr_sockets][,maxcpus=max_cpus]
smp_value is the legacy value specifying the total number of vCPUs for
the guest. If you specify one of cores, threads or sockets this value
can be omitted. Missing values will be computed to fulfill:
smp_value = nr_cores * nr_threads * nr_sockets
where it will favour sockets over cores over threads (to mimic the
current behavior, which will only inject multiple sockets.)
So -smp 4,threads=2 will inject two sockets with 2 threads each,
-smp cores=4 is an abbreviation for -smp 4,cores=4,threads=1,sockets=1.
If max_cpus (the number of hotpluggable CPUs) is omitted, it will
be set to smp_value.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2 files changed
tree: d20cf2527b1b5e400b5392c6dc8e0a5155870ebd
  1. audio/
  2. block/
  3. bsd-user/
  4. darwin-user/
  5. fpu/
  6. gdb-xml/
  7. hw/
  8. linux-user/
  9. pc-bios/
  10. slirp/
  11. target-alpha/
  12. target-arm/
  13. target-cris/
  14. target-i386/
  15. target-m68k/
  16. target-microblaze/
  17. target-mips/
  18. target-ppc/
  19. target-sh4/
  20. target-sparc/
  21. tcg/
  22. tests/
  23. .gitignore
  24. a.out.h
  25. acl.c
  26. acl.h
  27. aes.c
  28. aes.h
  29. aio.c
  30. alpha-dis.c
  31. alpha.ld
  32. arm-dis.c
  33. arm-semi.c
  34. arm.ld
  35. balloon.h
  36. block.c
  37. block.h
  38. block_int.h
  39. bswap.h
  40. bt-host.c
  41. bt-host.h
  42. bt-vhci.c
  43. buffered_file.c
  44. buffered_file.h
  45. cache-utils.c
  46. cache-utils.h
  47. Changelog
  48. cmd.c
  49. cmd.h
  50. cocoa.m
  51. CODING_STYLE
  52. configure
  53. console.c
  54. console.h
  55. COPYING
  56. COPYING.LIB
  57. cpu-all.h
  58. cpu-common.h
  59. cpu-defs.h
  60. cpu-exec.c
  61. create_config
  62. cris-dis.c
  63. curses.c
  64. curses_keys.h
  65. cutils.c
  66. d3des.c
  67. d3des.h
  68. def-helper.h
  69. device_tree.c
  70. device_tree.h
  71. dis-asm.h
  72. disas.c
  73. disas.h
  74. dma-helpers.c
  75. dma.h
  76. dyngen-exec.h
  77. elf.h
  78. elf_ops.h
  79. envlist.c
  80. envlist.h
  81. exec-all.h
  82. exec.c
  83. feature_to_c.sh
  84. gdbstub.c
  85. gdbstub.h
  86. gen-icount.h
  87. host-utils.c
  88. host-utils.h
  89. hostregs_helper.h
  90. hpet.h
  91. hppa-dis.c
  92. hppa.ld
  93. hxtool
  94. i386-dis.c
  95. i386.ld
  96. ia64.ld
  97. ioport-user.c
  98. ioport.c
  99. ioport.h
  100. keymaps.c
  101. keymaps.h
  102. kvm-all.c
  103. kvm.h
  104. libfdt_env.h
  105. LICENSE
  106. loader.c
  107. m68k-dis.c
  108. m68k-semi.c
  109. m68k.ld
  110. MAINTAINERS
  111. Makefile
  112. Makefile.hw
  113. Makefile.target
  114. microblaze-dis.c
  115. migration-exec.c
  116. migration-fd.c
  117. migration-tcp.c
  118. migration-unix.c
  119. migration.c
  120. migration.h
  121. mips-dis.c
  122. mips.ld
  123. module.c
  124. module.h
  125. monitor.c
  126. monitor.h
  127. nbd.c
  128. nbd.h
  129. net-checksum.c
  130. net.c
  131. net.h
  132. osdep.c
  133. osdep.h
  134. path.c
  135. pci-ids.txt
  136. posix-aio-compat.c
  137. posix-aio-compat.h
  138. ppc-dis.c
  139. ppc.ld
  140. ppc64.ld
  141. qemu-aio.h
  142. qemu-binfmt-conf.sh
  143. qemu-char.c
  144. qemu-char.h
  145. qemu-common.h
  146. qemu-config.c
  147. qemu-config.h
  148. qemu-doc.texi
  149. qemu-img-cmds.hx
  150. qemu-img.c
  151. qemu-img.texi
  152. qemu-io.c
  153. qemu-lock.h
  154. qemu-log.h
  155. qemu-malloc.c
  156. qemu-monitor.hx
  157. qemu-nbd.c
  158. qemu-nbd.texi
  159. qemu-option.c
  160. qemu-option.h
  161. qemu-options.hx
  162. qemu-sockets.c
  163. qemu-tech.texi
  164. qemu-thread.c
  165. qemu-thread.h
  166. qemu-timer.h
  167. qemu-tool.c
  168. qemu.sasl
  169. qemu_socket.h
  170. readline.c
  171. readline.h
  172. README
  173. rules.mak
  174. s390-dis.c
  175. s390.ld
  176. savevm.c
  177. sdl.c
  178. sdl_keysym.h
  179. sdl_zoom.c
  180. sdl_zoom.h
  181. sdl_zoom_template.h
  182. sh4-dis.c
  183. softmmu-semi.h
  184. softmmu_defs.h
  185. softmmu_exec.h
  186. softmmu_header.h
  187. softmmu_template.h
  188. sparc-dis.c
  189. sparc.ld
  190. sparc64.ld
  191. sys-queue.h
  192. sysemu.h
  193. tap-win32.c
  194. targphys.h
  195. texi2pod.pl
  196. thunk.c
  197. thunk.h
  198. TODO
  199. translate-all.c
  200. uboot_image.h
  201. usb-bsd.c
  202. usb-linux.c
  203. usb-stub.c
  204. VERSION
  205. vgafont.h
  206. vl.c
  207. vnc-auth-sasl.c
  208. vnc-auth-sasl.h
  209. vnc-auth-vencrypt.c
  210. vnc-auth-vencrypt.h
  211. vnc-tls.c
  212. vnc-tls.h
  213. vnc.c
  214. vnc.h
  215. vnc_keysym.h
  216. vnchextile.h
  217. x86_64.ld
  218. x_keymap.c
  219. x_keymap.h