Skip to contentSkip to conversation

qemu-options: Trivial doc fixes related to -smp

PATCH Applied Yanan Wang 4 participants 9 messages Sep 28, 2021 – Sep 29, 2021

lore
Share & tools
lore

Yanan Wang

author
#0 lore raw

v2 cover qemu-options: Trivial doc fixes related to -smp

v1->v2:
- update the subject and commit message of patch 2/2.
- add R-bs from Damien and Philippe. Thanks.

There are two places found related to -smp that may need to be fixed when reading qemu-options.hx. And after searching other Doc files, there hasn't been any other similar issues.

Yanan Wang (2):
qemu-options: Tweak [,maxcpus=cpus] to [,maxcpus=maxcpus]
qemu-options: Add missing "sockets=2,maxcpus=2" to CLI "-smp 2"

 qemu-options.hx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.19.1

author
#1 lore raw

PATCH v2 1/2 qemu-options: Tweak [, maxcpus=cpus] to [, maxcpus=maxcpus]

In qemu-option.hx, there is "-smp [[cpus=]n][,maxcpus=cpus]..." in the DEF part, and "-smp [[cpus=]n][,maxcpus=maxcpus]..." in the RST part. Obviously the later is right, let's fix the previous one.

---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-options.hx +1 -1
index 5c1b0311c0..dcd9595650 100644
@@ -200,7 +200,7 @@ SRST
 ERST
 
 DEF("smp", HAS_ARG, QEMU_OPTION_smp,
-    "-smp [[cpus=]n][,maxcpus=cpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\n"
+    "-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\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"
Signature · 1 line
2.19.1
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] qemu-options: Tweak [,maxcpus=cpus] to [,maxcpus=maxcpus]

Quoted 9 lines · Yanan Wang

In qemu-option.hx, there is "-smp [[cpus=]n][,maxcpus=cpus]..." in the DEF part, and "-smp [[cpus=]n][,maxcpus=maxcpus]..." in the RST part. Obviously the later is right, let's fix the previous one.

---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v2 1/2
#3 lore raw

Re: [PATCH v2 1/2] qemu-options: Tweak [,maxcpus=cpus] to [,maxcpus=maxcpus]

In reply to Yanan Wang
Quoted 26 lines · Yanan Wang

In qemu-option.hx, there is "-smp [[cpus=]n][,maxcpus=cpus]..." in the DEF part, and "-smp [[cpus=]n][,maxcpus=maxcpus]..." in the RST part. Obviously the later is right, let's fix the previous one.

---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-options.hx +1 -1
index 5c1b0311c0..dcd9595650 100644
@@ -200,7 +200,7 @@ SRST
 ERST
 
 DEF("smp", HAS_ARG, QEMU_OPTION_smp,
-    "-smp [[cpus=]n][,maxcpus=cpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\n"
+    "-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\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"
Signature · 1 line
2.19.1
#4 lore raw

Re: [PATCH v2 1/2] qemu-options: Tweak [, maxcpus=cpus] to [, maxcpus=maxcpus]

In reply to Yanan Wang

Le 28/09/2021 à 14:11, Yanan Wang a écrit :

Quoted 16 lines

In qemu-option.hx, there is "-smp [[cpus=]n][,maxcpus=cpus]..." in the DEF part, and "-smp [[cpus=]n][,maxcpus=maxcpus]..." in the RST part. Obviously the later is right, let's fix the previous one.

---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-options.hx +0 -0
index 5c1b0311c0..dcd9595650 100644

qemu-options.hx SRST · line 206

Quoted 8 lines
qemu-options.hx +1 -1
@@ -200,7 +200,7 @@ SRST
 ERST
 
 DEF("smp", HAS_ARG, QEMU_OPTION_smp,
-    "-smp [[cpus=]n][,maxcpus=cpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\n"
+    "-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\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"

Applied to my trivial-patches branch.

Thanks,
Laurent

author
#5 lore raw

PATCH v2 2/2 qemu-options: Add missing "sockets=2, maxcpus=2" to CLI "-smp 2"

In reply to Yanan Wang

There is one numa config example in qemu-options.hx currently using "-smp 2" and assuming that there will be 2 sockets and 2 cpus totally. However now the actual calculation logic of missing sockets and cores is not immutable and is considered liable to change. Although we will get maxcpus=2 finally based on current parser, it's always stable to specify it explicitly.

So "-smp 2,sockets=2,maxcpus=2" will be optimal when we expect multiple sockets and 2 cpus totally.

---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-options.hx +1 -1
index dcd9595650..ff8917c5e1 100644
@@ -395,7 +395,7 @@ SRST
         -m 2G \
         -object memory-backend-ram,size=1G,id=m0 \
         -object memory-backend-ram,size=1G,id=m1 \
-        -smp 2 \
+        -smp 2,sockets=2,maxcpus=2 \
         -numa node,nodeid=0,memdev=m0 \
         -numa node,nodeid=1,memdev=m1,initiator=0 \
         -numa cpu,node-id=0,socket-id=0 \
Signature · 1 line
2.19.1
Reviewed-by on v2 2/2
#6 lore raw

Re: [PATCH v2 2/2] qemu-options: Add missing "sockets=2,maxcpus=2" to CLI "-smp 2"

Quoted 7 lines · Yanan Wang

There is one numa config example in qemu-options.hx currently using "-smp 2" and assuming that there will be 2 sockets and 2 cpus totally. However now the actual calculation logic of missing sockets and cores is not immutable and is considered liable to change. Although we will get maxcpus=2 finally based on current parser, it's always stable to specify it explicitly.

Quoted 8 lines

So "-smp 2,sockets=2,maxcpus=2" will be optimal when we expect multiple sockets and 2 cpus totally.

---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Reviewed-by on v2 2/2
#7 lore raw

Re: [PATCH v2 2/2] qemu-options: Add missing "sockets=2,maxcpus=2" to CLI "-smp 2"

In reply to Yanan Wang
Quoted 32 lines · Yanan Wang

There is one numa config example in qemu-options.hx currently using "-smp 2" and assuming that there will be 2 sockets and 2 cpus totally. However now the actual calculation logic of missing sockets and cores is not immutable and is considered liable to change. Although we will get maxcpus=2 finally based on current parser, it's always stable to specify it explicitly.

So "-smp 2,sockets=2,maxcpus=2" will be optimal when we expect multiple sockets and 2 cpus totally.

---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-options.hx +1 -1
index dcd9595650..ff8917c5e1 100644
@@ -395,7 +395,7 @@ SRST
         -m 2G \
         -object memory-backend-ram,size=1G,id=m0 \
         -object memory-backend-ram,size=1G,id=m1 \
-        -smp 2 \
+        -smp 2,sockets=2,maxcpus=2 \
         -numa node,nodeid=0,memdev=m0 \
         -numa node,nodeid=1,memdev=m1,initiator=0 \
         -numa cpu,node-id=0,socket-id=0 \
Signature · 1 line
2.19.1
#8 lore raw

Re: [PATCH v2 2/2] qemu-options: Add missing "sockets=2, maxcpus=2" to CLI "-smp 2"

In reply to Yanan Wang

Le 28/09/2021 à 14:11, Yanan Wang a écrit :

Quoted 22 lines

There is one numa config example in qemu-options.hx currently using "-smp 2" and assuming that there will be 2 sockets and 2 cpus totally. However now the actual calculation logic of missing sockets and cores is not immutable and is considered liable to change. Although we will get maxcpus=2 finally based on current parser, it's always stable to specify it explicitly.

So "-smp 2,sockets=2,maxcpus=2" will be optimal when we expect multiple sockets and 2 cpus totally.

---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-options.hx +0 -0
index dcd9595650..ff8917c5e1 100644

qemu-options.hx SRST · line 401

Quoted 8 lines
qemu-options.hx +1 -1
@@ -395,7 +395,7 @@ SRST
         -m 2G \
         -object memory-backend-ram,size=1G,id=m0 \
         -object memory-backend-ram,size=1G,id=m1 \
-        -smp 2 \
+        -smp 2,sockets=2,maxcpus=2 \
         -numa node,nodeid=0,memdev=m0 \
         -numa node,nodeid=1,memdev=m1,initiator=0 \
         -numa cpu,node-id=0,socket-id=0 \

Applied to my trivial-patches branch.

Thanks,
Laurent