Skip to contentSkip to conversation

qemu-options: Trivial doc fixes related to -smp

PATCH Superseded Yanan Wang 4 participants 9 messages Sep 28, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yanan Wang

author
#0 lore raw

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

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" to CLI "-smp 2"

 qemu-options.hx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.19.1
author
#1 lore raw

PATCH 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 v1 1/2
#2 lore raw

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

Quoted 6 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.

---

Quoted 17 lines
  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"
author
#3 lore raw

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

In reply to Yanan Wang

There is one example of -smp CLI in qemu-options.hx currently using "-smp 2" and assuming that there will be 2 sockets. However now the actually calculation logic of missing sockets and cores is not immutable, we should use more explicit CLIs like "-smp 2,sockets=2" if we want multiple sockets.

---
 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
#4 lore raw

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

Quoted 16 lines · Yanan Wang

There is one example of -smp CLI in qemu-options.hx currently using "-smp 2" and assuming that there will be 2 sockets. However now the actually calculation logic of missing sockets and cores is not immutable, we should use more explicit CLIs like "-smp 2,sockets=2" if we want multiple sockets.

---
 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 398

Quoted 5 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 \

Is the addition of "maxcpus=2" intentional?

Quoted 4 lines
qemu-options.hx +0 -0
         -numa node,nodeid=0,memdev=m0 \
         -numa node,nodeid=1,memdev=m1,initiator=0 \
         -numa cpu,node-id=0,socket-id=0 \
#5 lore raw

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

Quoted 12 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Yanan Wang

There is one example of -smp CLI in qemu-options.hx currently using "-smp 2" and assuming that there will be 2 sockets. However now the actually calculation logic of missing sockets and cores is not immutable, we should use more explicit CLIs like "-smp 2,sockets=2" if we want multiple sockets.

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

qemu-options.hx SRST · line 398

Quoted 10 lines
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 \

Is the addition of "maxcpus=2" intentional?

Yes, but it's not necessary IMO. I just wanted to keep consistency with other numa config examples in the Doc. Should I remove it ?

Thanks,
Yanan

Quoted 5 lines

qemu-options.hx SRST · line 401

Quoted 4 lines
qemu-options.hx +0 -0
          -numa node,nodeid=0,memdev=m0 \
          -numa node,nodeid=1,memdev=m1,initiator=0 \
          -numa cpu,node-id=0,socket-id=0 \

.

#6 lore raw

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

Quoted 25 lines · wangyanan (Y)
Quoted 12 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Yanan Wang

There is one example of -smp CLI in qemu-options.hx currently using "-smp 2" and assuming that there will be 2 sockets. However now the actually calculation logic of missing sockets and cores is not immutable, we should use more explicit CLIs like "-smp 2,sockets=2" if we want multiple sockets.

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

qemu-options.hx SRST · line 398

Quoted 10 lines
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 \

Is the addition of "maxcpus=2" intentional?

Quoted 2 lines

Yes, but it's not necessary IMO. I just wanted to keep consistency with other numa config examples in the Doc. Should I remove it ?

I think it makes sense to be explicit, because the numa config works in terms of maxcpus when splitting cpus between nodes

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 :|
#7 lore raw

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

Quoted 25 lines · Daniel P. Berrangé
Quoted 24 lines · wangyanan (Y)
Quoted 23 lines · Philippe Mathieu-Daudé
Quoted 16 lines · Yanan Wang

There is one example of -smp CLI in qemu-options.hx currently using "-smp 2" and assuming that there will be 2 sockets. However now the actually calculation logic of missing sockets and cores is not immutable, we should use more explicit CLIs like "-smp 2,sockets=2" if we want multiple sockets.

---
   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 398

Quoted 5 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 \

Is the addition of "maxcpus=2" intentional?

Quoted 4 lines
Quoted 2 lines

Yes, but it's not necessary IMO. I just wanted to keep consistency with other numa config examples in the Doc. Should I remove it ?

I think it makes sense to be explicit, because the numa config works in terms of maxcpus when splitting cpus between nodes

The statement of this numa config example actually assume that there will be 2 cpus totally. Although based on behavior of the smp parser we will get maxcpus=2, I also tend to keep it explicitly.

But I should update subject of this patch and the commit message.

Thanks,
Yanan

#8 lore raw

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

Quoted 29 lines · wangyanan (Y)
Quoted 27 lines · Daniel P. Berrangé
Quoted 26 lines · wangyanan (Y)
Quoted 12 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Yanan Wang

There is one example of -smp CLI in qemu-options.hx currently using "-smp 2" and assuming that there will be 2 sockets. However now the actually calculation logic of missing sockets and cores is not immutable, we should use more explicit CLIs like "-smp 2,sockets=2" if we want multiple sockets.

---
   qemu-options.hx | 2 +-

   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

qemu-options.hx SRST · line 398

Quoted 10 lines
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 \

Is the addition of "maxcpus=2" intentional?

Yes, but it's not necessary IMO. I just wanted to keep consistency with other numa config examples in the Doc. Should I remove it ?

Quoted 7 lines
Quoted 2 lines

I think it makes sense to be explicit, because the numa config works in terms of maxcpus when splitting cpus between nodes

The statement of this numa config example actually assume that there will be 2 cpus totally. Although based on behavior of the smp parser we will get maxcpus=2, I also tend to keep it explicitly.

But I should update subject of this patch and the commit message.

Once updated: