[libvirt] [PATCH 1/3] qemu_monitor_json: Populate CPUModelInfo struct from json
Erik Skultety
eskultet at redhat.com
Mon Apr 16 08:06:56 UTC 2018
On Mon, Apr 16, 2018 at 01:06:56AM -0500, Chris Venteicher wrote:
> New function qemuMonitorJSONBuildCPUModelInfo created by extracting code
> from existing function qemuMonitorJSONGetCPUModelExpansion to create a
> reusable function for extracting cpu model info from json.
> ---
> src/qemu/qemu_monitor_json.c | 82 ++++++++++++++++++++++++++++++--------------
> 1 file changed, 56 insertions(+), 26 deletions(-)
>
...
> + if (virJSONValueObjectForeachKeyValue(cpu_props,
> + qemuMonitorJSONParseCPUModelProperty,
> + machine_model) < 0)
> + goto cleanup;
> +
> + ret = 0;
> + *model = machine_model;
> + machine_model = NULL;
we also tend to use VIR_STEAL_PTR(dst, src) in ^this case.
Erik
More information about the libvir-list
mailing list