[libvirt] [PATCH 07/27] qemu: monitor: Add support for calling query-hotpluggable-cpus

Pavel Hrdina phrdina at redhat.com
Tue Aug 9 14:57:13 UTC 2016


On Fri, Aug 05, 2016 at 03:56:03PM +0200, Peter Krempa wrote:
> Add support for retrieving information regarding hotpluggable cpu units
> supported by qemu. Data returned by the command carries information
> needed to figure out the granularity of hotplug, the necessary cpu type
> name and the topology information.
> 
> Note that qemu doesn't specify any particular order of the entries thus
> it's necessary sort them by socket_id, core_id and thread_id to the
> order libvirt expects.
> ---
>  src/qemu/qemu_monitor.h      |  16 ++++
>  src/qemu/qemu_monitor_json.c | 170 +++++++++++++++++++++++++++++++++++++++++++
>  src/qemu/qemu_monitor_json.h |   5 ++
>  3 files changed, 191 insertions(+)

[...]

> +    /* qom path is not present unless the vCPU is online */
> +    if ((tmp = virJSONValueObjectGetString(vcpu, "qom-path"))) {
> +        if (VIR_STRDUP(entry->qom_path, tmp) < 0)
> +            return -1;
> +
> +        /* alias is the part after last slash having a "vcpu-device" prefix */

s/vcpu-device/vcpu/

> +        if ((tmp = strrchr(tmp, '/')) && STRPREFIX(tmp + 1, "vcpu")) {
> +            if (VIR_STRDUP(entry->alias, tmp + 1) < 0)
> +                return -1;
> +        }
> +    }
> +
> +    return 0;
> +}

ACK




More information about the libvir-list mailing list