Skip to contentSkip to conversation

docs/system/cpu-hotplug: Update example's socket-id/core-id

PATCH Superseded Peter Maydell 2 participants 8 messages Aug 19, 2024 – Oct 7, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs/system/cpu-hotplug: Update example's socket-id/core-id

At some point the way we allocate socket-id and core-id to CPUs by default changed; update the example of how to do CPU hotplug and unplug so the example commands work again. The differences in the sample input and output are:
* the second CPU is now socket-id=0 core-id=1,
not socket-id=1 core-id=0
* the order of fields from the qmp_shell is different (it seems to now always be in alphabetical order)

---
I noticed this while I was playing around with vcpu hotplug trying to demonstrate a memory leak I want to fix...

 docs/system/cpu-hotplug.rst | 54 ++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 28 deletions(-)
docs/system/cpu-hotplug.rst +26 -28
index 015ce2b6ec3..443ff226b90 100644
@@ -33,23 +33,23 @@ vCPU hotplug
       {
           "return": [
               {
-                  "type": "IvyBridge-IBRS-x86_64-cpu",
-                  "vcpus-count": 1,
                   "props": {
-                      "socket-id": 1,
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
-                  }
+                  },
+                  "type": "IvyBridge-IBRS-x86_64-cpu",
+                  "vcpus-count": 1
               },
               {
+                  "props": {
+                      "core-id": 0,
+                      "socket-id": 0,
+                      "thread-id": 0
+                  },
                   "qom-path": "/machine/unattached/device[0]",
                   "type": "IvyBridge-IBRS-x86_64-cpu",
-                  "vcpus-count": 1,
-                  "props": {
-                      "socket-id": 0,
-                      "core-id": 0,
-                      "thread-id": 0
-                  }
+                  "vcpus-count": 1
               }
           ]
       }
@@ -58,18 +58,18 @@ vCPU hotplug
 (4) The ``query-hotpluggable-cpus`` command returns an object for CPUs
     that are present (containing a "qom-path" member) or which may be
     hot-plugged (no "qom-path" member).  From its output in step (3), we
-    can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0,
-    while hot-plugging a CPU into socket 1 requires passing the listed
+    can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0 core 0,
+    while hot-plugging a CPU into socket 0 core 1 requires passing the listed
     properties to QMP ``device_add``::
 
       (QEMU) device_add id=cpu-2 driver=IvyBridge-IBRS-x86_64-cpu socket-id=1 core-id=0 thread-id=0
       {
           "execute": "device_add",
           "arguments": {
-              "socket-id": 1,
+              "core-id": 1,
               "driver": "IvyBridge-IBRS-x86_64-cpu",
               "id": "cpu-2",
-              "core-id": 0,
+              "socket-id": 0,
               "thread-id": 0
           }
       }
@@ -83,34 +83,32 @@ vCPU hotplug
 
       (QEMU) query-cpus-fast
       {
-          "execute": "query-cpus-fast",
           "arguments": {}
+          "execute": "query-cpus-fast",
       }
       {
           "return": [
               {
-                  "qom-path": "/machine/unattached/device[0]",
-                  "target": "x86_64",
-                  "thread-id": 11534,
                   "cpu-index": 0,
                   "props": {
-                      "socket-id": 0,
                       "core-id": 0,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/unattached/device[0]",
+                  "target": "x86_64",
+                  "thread-id": 28957
               },
               {
-                  "qom-path": "/machine/peripheral/cpu-2",
-                  "target": "x86_64",
-                  "thread-id": 12106,
                   "cpu-index": 1,
                   "props": {
-                      "socket-id": 1,
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/peripheral/cpu-2",
+                  "target": "x86_64",
+                  "thread-id": 29095
               }
           ]
       }
@@ -123,10 +121,10 @@ From the 'qmp-shell', invoke the QMP ``device_del`` command::
 
       (QEMU) device_del id=cpu-2
       {
-          "execute": "device_del",
           "arguments": {
               "id": "cpu-2"
           }
+          "execute": "device_del",
       }
       {
           "return": {}
Signature · 1 line
2.34.1
#1 lore raw
Quoted 10 lines · Peter Maydell

At some point the way we allocate socket-id and core-id to CPUs by default changed; update the example of how to do CPU hotplug and unplug so the example commands work again. The differences in the sample input and output are:
* the second CPU is now socket-id=0 core-id=1,
not socket-id=1 core-id=0
* the order of fields from the qmp_shell is different (it seems to now always be in alphabetical order)

Quoted 4 lines

---
I noticed this while I was playing around with vcpu hotplug trying to demonstrate a memory leak I want to fix...

Ping for review on this one, please?

thanks
-- PMM

Quoted 126 lines
 docs/system/cpu-hotplug.rst | 54 ++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 28 deletions(-)
docs/system/cpu-hotplug.rst +26 -29
index 015ce2b6ec3..443ff226b90 100644
@@ -33,23 +33,23 @@ vCPU hotplug
       {
           "return": [
               {
-                  "type": "IvyBridge-IBRS-x86_64-cpu",
-                  "vcpus-count": 1,
                   "props": {
-                      "socket-id": 1,
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
-                  }
+                  },
+                  "type": "IvyBridge-IBRS-x86_64-cpu",
+                  "vcpus-count": 1
               },
               {
+                  "props": {
+                      "core-id": 0,
+                      "socket-id": 0,
+                      "thread-id": 0
+                  },
                   "qom-path": "/machine/unattached/device[0]",
                   "type": "IvyBridge-IBRS-x86_64-cpu",
-                  "vcpus-count": 1,
-                  "props": {
-                      "socket-id": 0,
-                      "core-id": 0,
-                      "thread-id": 0
-                  }
+                  "vcpus-count": 1
               }
           ]
       }
@@ -58,18 +58,18 @@ vCPU hotplug
 (4) The ``query-hotpluggable-cpus`` command returns an object for CPUs
     that are present (containing a "qom-path" member) or which may be
     hot-plugged (no "qom-path" member).  From its output in step (3), we
-    can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0,
-    while hot-plugging a CPU into socket 1 requires passing the listed
+    can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0 core 0,
+    while hot-plugging a CPU into socket 0 core 1 requires passing the listed
     properties to QMP ``device_add``::
 
       (QEMU) device_add id=cpu-2 driver=IvyBridge-IBRS-x86_64-cpu socket-id=1 core-id=0 thread-id=0
       {
           "execute": "device_add",
           "arguments": {
-              "socket-id": 1,
+              "core-id": 1,
               "driver": "IvyBridge-IBRS-x86_64-cpu",
               "id": "cpu-2",
-              "core-id": 0,
+              "socket-id": 0,
               "thread-id": 0
           }
       }
@@ -83,34 +83,32 @@ vCPU hotplug
 
       (QEMU) query-cpus-fast
       {
-          "execute": "query-cpus-fast",
           "arguments": {}
+          "execute": "query-cpus-fast",
       }
       {
           "return": [
               {
-                  "qom-path": "/machine/unattached/device[0]",
-                  "target": "x86_64",
-                  "thread-id": 11534,
                   "cpu-index": 0,
                   "props": {
-                      "socket-id": 0,
                       "core-id": 0,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/unattached/device[0]",
+                  "target": "x86_64",
+                  "thread-id": 28957
               },
               {
-                  "qom-path": "/machine/peripheral/cpu-2",
-                  "target": "x86_64",
-                  "thread-id": 12106,
                   "cpu-index": 1,
                   "props": {
-                      "socket-id": 1,
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/peripheral/cpu-2",
+                  "target": "x86_64",
+                  "thread-id": 29095
               }
           ]
       }
@@ -123,10 +121,10 @@ From the 'qmp-shell', invoke the QMP ``device_del`` command::
 
       (QEMU) device_del id=cpu-2
       {
-          "execute": "device_del",
           "arguments": {
               "id": "cpu-2"
           }
+          "execute": "device_del",
       }
       {
           "return": {}
--

2.34.1

#2 lore raw
In reply to Peter Maydell
Quoted 69 lines · On Mon, 19 Aug 2024 15:43:03 +0100 Peter Maydell <[email protected]>…

At some point the way we allocate socket-id and core-id to CPUs by default changed; update the example of how to do CPU hotplug and unplug so the example commands work again. The differences in the sample input and output are:
* the second CPU is now socket-id=0 core-id=1,
not socket-id=1 core-id=0
* the order of fields from the qmp_shell is different (it seems to now always be in alphabetical order)

---
I noticed this while I was playing around with vcpu hotplug trying to demonstrate a memory leak I want to fix...

 docs/system/cpu-hotplug.rst | 54 ++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 28 deletions(-)
docs/system/cpu-hotplug.rst +13 -13
index 015ce2b6ec3..443ff226b90 100644
@@ -33,23 +33,23 @@ vCPU hotplug
       {
           "return": [
               {
-                  "type": "IvyBridge-IBRS-x86_64-cpu",
-                  "vcpus-count": 1,
                   "props": {
-                      "socket-id": 1,
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
-                  }
+                  },
+                  "type": "IvyBridge-IBRS-x86_64-cpu",
+                  "vcpus-count": 1
               },
               {
+                  "props": {
+                      "core-id": 0,
+                      "socket-id": 0,
+                      "thread-id": 0
+                  },
                   "qom-path": "/machine/unattached/device[0]",
                   "type": "IvyBridge-IBRS-x86_64-cpu",
-                  "vcpus-count": 1,
-                  "props": {
-                      "socket-id": 0,
-                      "core-id": 0,
-                      "thread-id": 0
-                  }
+                  "vcpus-count": 1
               }
           ]
       }
@@ -58,18 +58,18 @@ vCPU hotplug
 (4) The ``query-hotpluggable-cpus`` command returns an object for CPUs
     that are present (containing a "qom-path" member) or which may be
     hot-plugged (no "qom-path" member).  From its output in step (3), we
-    can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0,
-    while hot-plugging a CPU into socket 1 requires passing the listed
+    can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0 core 0,
+    while hot-plugging a CPU into socket 0 core 1 requires passing the listed
     properties to QMP ``device_add``::
 
 
       (QEMU) device_add id=cpu-2 driver=IvyBridge-IBRS-x86_64-cpu socket-id=1 core-id=0 thread-id=0
 

docs/system/cpu-hotplug.rst vCPU hotplug · line 75

Quoted 10 lines
docs/system/cpu-hotplug.rst +2 -2
       {
           "execute": "device_add",
           "arguments": {
-              "socket-id": 1,
+              "core-id": 1,
               "driver": "IvyBridge-IBRS-x86_64-cpu",
               "id": "cpu-2",
-              "core-id": 0,
+              "socket-id": 0,
               "thread-id": 0

after above changes device_add doesn't match comment nor 'execute' output

Quoted 35 lines
           }
       }
docs/system/cpu-hotplug.rst +5 -10
@@ -83,34 +83,32 @@ vCPU hotplug
 
       (QEMU) query-cpus-fast
       {
-          "execute": "query-cpus-fast",
           "arguments": {}
+          "execute": "query-cpus-fast",
       }
       {
           "return": [
               {
-                  "qom-path": "/machine/unattached/device[0]",
-                  "target": "x86_64",
-                  "thread-id": 11534,
                   "cpu-index": 0,
                   "props": {
-                      "socket-id": 0,
                       "core-id": 0,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/unattached/device[0]",
+                  "target": "x86_64",
+                  "thread-id": 28957
               },
               {
-                  "qom-path": "/machine/peripheral/cpu-2",
-                  "target": "x86_64",
-                  "thread-id": 12106,
                   "cpu-index": 1,
                   "props": {
-                      "socket-id": 1,

docs/system/cpu-hotplug.rst vCPU hotplug · line 112

Quoted 10 lines
docs/system/cpu-hotplug.rst +5 -2
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/peripheral/cpu-2",
+                  "target": "x86_64",
+                  "thread-id": 29095
               }

beside reordering, which seems fine, this hunk also introduces target change perhaps a separate patch for that?

Quoted 14 lines
docs/system/cpu-hotplug.rst +1 -1
           ]
       }
@@ -123,10 +121,10 @@ From the 'qmp-shell', invoke the QMP ``device_del`` command::
 
       (QEMU) device_del id=cpu-2
       {
-          "execute": "device_del",
           "arguments": {
               "id": "cpu-2"
           }
+          "execute": "device_del",
       }
       {
           "return": {}
#3 lore raw
Quoted 84 lines · Igor Mammedov
Quoted 69 lines · On Mon, 19 Aug 2024 15:43:03 +0100 Peter Maydell <[email protected]>…

At some point the way we allocate socket-id and core-id to CPUs by default changed; update the example of how to do CPU hotplug and unplug so the example commands work again. The differences in the sample input and output are:
* the second CPU is now socket-id=0 core-id=1,
not socket-id=1 core-id=0
* the order of fields from the qmp_shell is different (it seems to now always be in alphabetical order)

---
I noticed this while I was playing around with vcpu hotplug trying to demonstrate a memory leak I want to fix...

 docs/system/cpu-hotplug.rst | 54 ++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 28 deletions(-)
docs/system/cpu-hotplug.rst +13 -13
index 015ce2b6ec3..443ff226b90 100644
@@ -33,23 +33,23 @@ vCPU hotplug
       {
           "return": [
               {
-                  "type": "IvyBridge-IBRS-x86_64-cpu",
-                  "vcpus-count": 1,
                   "props": {
-                      "socket-id": 1,
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
-                  }
+                  },
+                  "type": "IvyBridge-IBRS-x86_64-cpu",
+                  "vcpus-count": 1
               },
               {
+                  "props": {
+                      "core-id": 0,
+                      "socket-id": 0,
+                      "thread-id": 0
+                  },
                   "qom-path": "/machine/unattached/device[0]",
                   "type": "IvyBridge-IBRS-x86_64-cpu",
-                  "vcpus-count": 1,
-                  "props": {
-                      "socket-id": 0,
-                      "core-id": 0,
-                      "thread-id": 0
-                  }
+                  "vcpus-count": 1
               }
           ]
       }
@@ -58,18 +58,18 @@ vCPU hotplug
 (4) The ``query-hotpluggable-cpus`` command returns an object for CPUs
     that are present (containing a "qom-path" member) or which may be
     hot-plugged (no "qom-path" member).  From its output in step (3), we
-    can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0,
-    while hot-plugging a CPU into socket 1 requires passing the listed
+    can see that ``IvyBridge-IBRS-x86_64-cpu`` is present in socket 0 core 0,
+    while hot-plugging a CPU into socket 0 core 1 requires passing the listed
     properties to QMP ``device_add``::
 
 
       (QEMU) device_add id=cpu-2 driver=IvyBridge-IBRS-x86_64-cpu socket-id=1 core-id=0 thread-id=0
 

docs/system/cpu-hotplug.rst vCPU hotplug · line 75

Quoted 10 lines
docs/system/cpu-hotplug.rst +2 -2
       {
           "execute": "device_add",
           "arguments": {
-              "socket-id": 1,
+              "core-id": 1,
               "driver": "IvyBridge-IBRS-x86_64-cpu",
               "id": "cpu-2",
-              "core-id": 0,
+              "socket-id": 0,
               "thread-id": 0
Quoted 1 line

after above changes device_add doesn't match comment nor 'execute' output

Oops, yes. The device_add line should be changed too ("socket-id=0 core-id=1 thread-id=0").

Quoted 41 lines
Quoted 41 lines
           }
       }
docs/system/cpu-hotplug.rst +7 -11
@@ -83,34 +83,32 @@ vCPU hotplug
 
       (QEMU) query-cpus-fast
       {
-          "execute": "query-cpus-fast",
           "arguments": {}
+          "execute": "query-cpus-fast",
       }
       {
           "return": [
               {
-                  "qom-path": "/machine/unattached/device[0]",
-                  "target": "x86_64",
-                  "thread-id": 11534,
                   "cpu-index": 0,
                   "props": {
-                      "socket-id": 0,
                       "core-id": 0,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/unattached/device[0]",
+                  "target": "x86_64",
+                  "thread-id": 28957
               },
               {
-                  "qom-path": "/machine/peripheral/cpu-2",
-                  "target": "x86_64",
-                  "thread-id": 12106,
                   "cpu-index": 1,
                   "props": {
-                      "socket-id": 1,
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
Quoted 8 lines

docs/system/cpu-hotplug.rst vCPU hotplug · line 112

Quoted 5 lines
docs/system/cpu-hotplug.rst +3 -1
-                  "arch": "x86"
+                  "qom-path": "/machine/peripheral/cpu-2",
+                  "target": "x86_64",
+                  "thread-id": 29095
               }

beside reordering, which seems fine, this hunk also introduces target change perhaps a separate patch for that?

What target change? It all says "target": "x86_64" both before and after.

thanks
-- PMM

#4 lore raw
Quoted 52 lines · Peter Maydell
Quoted 41 lines · Igor Mammedov
Quoted 38 lines · On Mon, 19 Aug 2024 15:43:03 +0100 Peter Maydell <[email protected]>…
docs/system/cpu-hotplug.rst +7 -11
@@ -83,34 +83,32 @@ vCPU hotplug
 
       (QEMU) query-cpus-fast
       {
-          "execute": "query-cpus-fast",
           "arguments": {}
+          "execute": "query-cpus-fast",
       }
       {
           "return": [
               {
-                  "qom-path": "/machine/unattached/device[0]",
-                  "target": "x86_64",
-                  "thread-id": 11534,
                   "cpu-index": 0,
                   "props": {
-                      "socket-id": 0,
                       "core-id": 0,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/unattached/device[0]",
+                  "target": "x86_64",
+                  "thread-id": 28957
               },
               {
-                  "qom-path": "/machine/peripheral/cpu-2",
-                  "target": "x86_64",
-                  "thread-id": 12106,
                   "cpu-index": 1,
                   "props": {
-                      "socket-id": 1,
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
Quoted 8 lines

docs/system/cpu-hotplug.rst vCPU hotplug · line 112

Quoted 5 lines
docs/system/cpu-hotplug.rst +3 -1
-                  "arch": "x86"
+                  "qom-path": "/machine/peripheral/cpu-2",
+                  "target": "x86_64",
+                  "thread-id": 29095
               }

beside reordering, which seems fine, this hunk also introduces target change perhaps a separate patch for that?

Quoted 2 lines

What target change? It all says "target": "x86_64" both before and after.

Hi Igor, would you mind clarifying what you meant here? I'm happy to respin, but I don't understand what change you're asking for.

thanks
-- PMM

#5 lore raw
Quoted 53 lines · On Thu, 19 Sep 2024 13:34:54 +0100 Peter Maydell <[email protected]>…
Quoted 52 lines · Peter Maydell
Quoted 49 lines · Igor Mammedov
Quoted 33 lines · On Mon, 19 Aug 2024 15:43:03 +0100 Peter Maydell <[email protected]>…
docs/system/cpu-hotplug.rst +5 -10
@@ -83,34 +83,32 @@ vCPU hotplug
 
       (QEMU) query-cpus-fast
       {
-          "execute": "query-cpus-fast",
           "arguments": {}
+          "execute": "query-cpus-fast",
       }
       {
           "return": [
               {
-                  "qom-path": "/machine/unattached/device[0]",
-                  "target": "x86_64",
-                  "thread-id": 11534,
                   "cpu-index": 0,
                   "props": {
-                      "socket-id": 0,
                       "core-id": 0,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/unattached/device[0]",
+                  "target": "x86_64",
+                  "thread-id": 28957
               },
               {
-                  "qom-path": "/machine/peripheral/cpu-2",
-                  "target": "x86_64",
-                  "thread-id": 12106,
                   "cpu-index": 1,
                   "props": {
-                      "socket-id": 1,

docs/system/cpu-hotplug.rst vCPU hotplug · line 112

Quoted 10 lines
docs/system/cpu-hotplug.rst +5 -2
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/peripheral/cpu-2",
+                  "target": "x86_64",
+                  "thread-id": 29095
               }  

beside reordering, which seems fine, this hunk also introduces target change perhaps a separate patch for that?

Quoted 2 lines
Quoted 2 lines

What target change? It all says "target": "x86_64" both before and after.

my mistake,
I should've said '"arch": "x86"' instead, which is gone after the patch

Quoted 8 lines

Hi Igor, would you mind clarifying what you meant here? I'm happy to respin, but I don't understand what change you're asking for.

thanks
-- PMM

#6 lore raw
Quoted 57 lines · Igor Mammedov
Quoted 53 lines · On Thu, 19 Sep 2024 13:34:54 +0100 Peter Maydell <[email protected]>…
Quoted 52 lines · Peter Maydell
Quoted 49 lines · Igor Mammedov
Quoted 33 lines · On Mon, 19 Aug 2024 15:43:03 +0100 Peter Maydell <[email protected]>…
docs/system/cpu-hotplug.rst +5 -10
@@ -83,34 +83,32 @@ vCPU hotplug
 
       (QEMU) query-cpus-fast
       {
-          "execute": "query-cpus-fast",
           "arguments": {}
+          "execute": "query-cpus-fast",
       }
       {
           "return": [
               {
-                  "qom-path": "/machine/unattached/device[0]",
-                  "target": "x86_64",
-                  "thread-id": 11534,
                   "cpu-index": 0,
                   "props": {
-                      "socket-id": 0,
                       "core-id": 0,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/unattached/device[0]",
+                  "target": "x86_64",
+                  "thread-id": 28957
               },
               {
-                  "qom-path": "/machine/peripheral/cpu-2",
-                  "target": "x86_64",
-                  "thread-id": 12106,
                   "cpu-index": 1,
                   "props": {
-                      "socket-id": 1,

docs/system/cpu-hotplug.rst vCPU hotplug · line 112

Quoted 10 lines
docs/system/cpu-hotplug.rst +5 -2
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/peripheral/cpu-2",
+                  "target": "x86_64",
+                  "thread-id": 29095
               }

beside reordering, which seems fine, this hunk also introduces target change perhaps a separate patch for that?

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

What target change? It all says "target": "x86_64" both before and after.

my mistake,
I should've said '"arch": "x86"' instead, which is gone after the patch

This is because the "arch" output member was removed from the query-cpus-fast output in QEMU 6.0. If we mention this also in the commit message, is that OK?

======
docs/system/cpu-hotplug: Update example to match current QEMU

The example of how to do vCPU hotplug and hot-unlpug in the cpu-hotplug documentation no longer works, because the way we allocate socket-id and core-id to CPUs by default has changed at some point. The output also no longer matches what current QEMU produces in some more cosmetic ways.

Update the example to match current QEMU. The differences are:
* the second CPU is now socket-id=0 core-id=1,
not socket-id=1 core-id=0
* the order of fields from the qmp_shell is now in alphabetical order
* the "arch" member is no longer present in the query-cpus-fast output (it was removed in QEMU 6.0)

======

If that seems OK to you I'll send out a v2 with the updated commit message and the fix to the device_add line.

thanks
-- PMM

Acked-by
#7 lore raw
Quoted 85 lines · On Thu, 3 Oct 2024 15:54:45 +0100 Peter Maydell <[email protected]>…
Quoted 57 lines · Igor Mammedov
Quoted 53 lines · On Thu, 19 Sep 2024 13:34:54 +0100 Peter Maydell <[email protected]>…
Quoted 52 lines · Peter Maydell
Quoted 49 lines · Igor Mammedov
Quoted 33 lines · On Mon, 19 Aug 2024 15:43:03 +0100 Peter Maydell <[email protected]>…
docs/system/cpu-hotplug.rst +5 -10
@@ -83,34 +83,32 @@ vCPU hotplug
 
       (QEMU) query-cpus-fast
       {
-          "execute": "query-cpus-fast",
           "arguments": {}
+          "execute": "query-cpus-fast",
       }
       {
           "return": [
               {
-                  "qom-path": "/machine/unattached/device[0]",
-                  "target": "x86_64",
-                  "thread-id": 11534,
                   "cpu-index": 0,
                   "props": {
-                      "socket-id": 0,
                       "core-id": 0,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/unattached/device[0]",
+                  "target": "x86_64",
+                  "thread-id": 28957
               },
               {
-                  "qom-path": "/machine/peripheral/cpu-2",
-                  "target": "x86_64",
-                  "thread-id": 12106,
                   "cpu-index": 1,
                   "props": {
-                      "socket-id": 1,

docs/system/cpu-hotplug.rst vCPU hotplug · line 112

Quoted 10 lines
docs/system/cpu-hotplug.rst +5 -2
-                      "core-id": 0,
+                      "core-id": 1,
+                      "socket-id": 0,
                       "thread-id": 0
                   },
-                  "arch": "x86"
+                  "qom-path": "/machine/peripheral/cpu-2",
+                  "target": "x86_64",
+                  "thread-id": 29095
               }  

beside reordering, which seems fine, this hunk also introduces target change perhaps a separate patch for that?

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

What target change? It all says "target": "x86_64" both before and after.

my mistake,
I should've said '"arch": "x86"' instead, which is gone after the patch

This is because the "arch" output member was removed from the query-cpus-fast output in QEMU 6.0. If we mention this also in the commit message, is that OK?

======
docs/system/cpu-hotplug: Update example to match current QEMU

The example of how to do vCPU hotplug and hot-unlpug in the cpu-hotplug documentation no longer works, because the way we allocate socket-id and core-id to CPUs by default has changed at some point. The output also no longer matches what current QEMU produces in some more cosmetic ways.

Update the example to match current QEMU. The differences are:
* the second CPU is now socket-id=0 core-id=1,
not socket-id=1 core-id=0
* the order of fields from the qmp_shell is now in alphabetical order
* the "arch" member is no longer present in the query-cpus-fast output (it was removed in QEMU 6.0)

Quoted 2 lines

======

Quoted 7 lines

If that seems OK to you I'll send out a v2 with the updated commit message and the fix to the device_add line.

thanks
-- PMM