[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qmp: Add qom-path field to query-cpus command

From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] qmp: Add qom-path field to query-cpus command
Date: Mon, 04 May 2015 13:17:06 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 05/04/2015 01:09 PM, Eduardo Habkost wrote:
> This will allow clients to query additional information directly using
> qom-get on the CPU objects.
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> Reference to previous discussion:
>   Date: Mon, 4 May 2015 15:37:40 -0300
>   From: Eduardo Habkost <address@hidden>
>   Message-ID: <address@hidden>
>   Subject: Re: [Qemu-devel] [PATCH] cpu: Register QOM links at 
> /machine/cpus/<index>
> The summary is: even if we provide predictable QOM paths for the CPU
> objects, the qom-path field will be useful to allow the QOM objects and
> query-cpu data to be matched correctly.
> ---

> +++ b/qapi-schema.json
> @@ -602,6 +602,8 @@
>  # @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.
> +#

Needs a '(since 2.4)' designation. But definitely looks useful.

>  # @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
> @@ -622,8 +624,9 @@
>  #        data is sent to the client, the guest may no longer be halted.
>  ##
>  { 'type': 'CpuInfo',

Rebase context fun once my series goes in that does s/type/struct/

> -  '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'} }

We now have a mix of _ (thread_id) and - (qom-path). It might be nice to
someday teach QMP to interchange either spelling.  I'm on the fence as
to whether this should use qom_path in order to be consistent within the
struct itself.

> +++ b/qmp-commands.hx
> @@ -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)

The new output is not optional, so the example needs to be updated to
show it.  For that matter, the example is broken, so you could fix it
while touching it:


is not valid JSON, since there is a missing comma for "pc".

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]