]> Git Repo - qemu.git/commitdiff
qmp: Add qom_path field to query-cpus command
authorEduardo Habkost <[email protected]>
Fri, 8 May 2015 19:04:22 +0000 (16:04 -0300)
committerMarkus Armbruster <[email protected]>
Thu, 14 May 2015 15:25:46 +0000 (17:25 +0200)
This will allow clients to query additional information directly using
qom-get on the CPU objects.

Reviewed-by: David Gibson <[email protected]>
Reviewed-by: Andreas Färber <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
cpus.c
qapi-schema.json
qmp-commands.hx

diff --git a/cpus.c b/cpus.c
index 62d157a85c05eedc14aa07137720731857d9d8a6..de6469fa8d6793a5981ad5742c5108c0da7b3140 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -1435,6 +1435,7 @@ CpuInfoList *qmp_query_cpus(Error **errp)
         info->value->CPU = cpu->cpu_index;
         info->value->current = (cpu == first_cpu);
         info->value->halted = cpu->halted;
+        info->value->qom_path = object_get_canonical_path(OBJECT(cpu));
         info->value->thread_id = cpu->thread_id;
 #if defined(TARGET_I386)
         info->value->has_pc = true;
index 9c92482898dba5a92a39955977a43739e335189a..f97ffa1132de22c81835d7da83bc49372be9b52b 100644 (file)
 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
 #          to a processor specific low power mode.
 #
+# @qom_path: path to the CPU object in the QOM tree (since 2.4)
+#
 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
 #                pointer.
 #                If the target is Sparc, this is the PC component of the
 #        data is sent to the client, the guest may no longer be halted.
 ##
 { 'struct': 'CpuInfo',
-  'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
-           '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
+  'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
+           'qom_path': 'str',
+           '*pc': 'int', '*nip': 'int', '*npc': 'int', '*PC': 'int',
+           'thread_id': 'int'} }
 
 ##
 # @query-cpus:
index 7506774afbcd589d6ca57c6fe11681cb1fe6bb2c..14e109eb5cc8f51bc3a4424603f6c4e6606938e3 100644 (file)
@@ -2569,6 +2569,7 @@ Return a json-array. Each CPU is represented by a json-object, which contains:
 - "CPU": CPU index (json-int)
 - "current": true if this is the current CPU, false otherwise (json-bool)
 - "halted": true if the cpu is halted, false otherwise (json-bool)
+- "qom_path": path to the CPU object in the QOM tree (json-str)
 - Current program counter. The key's name depends on the architecture:
      "pc": i386/x86_64 (json-int)
      "nip": PPC (json-int)
@@ -2585,14 +2586,16 @@ Example:
             "CPU":0,
             "current":true,
             "halted":false,
-            "pc":3227107138
+            "qom_path":"/machine/unattached/device[0]",
+            "pc":3227107138,
             "thread_id":3134
          },
          {
             "CPU":1,
             "current":false,
             "halted":true,
-            "pc":7108165
+            "qom_path":"/machine/unattached/device[2]",
+            "pc":7108165,
             "thread_id":3135
          }
       ]
This page took 0.038201 seconds and 4 git commands to generate.