[libvirt] [PATCH 3/6] qemu: qmp query-cpu-model-expansion command

Jiri Denemark jdenemar at redhat.com
Wed Nov 30 08:53:03 UTC 2016


On Tue, Nov 29, 2016 at 15:44:46 -0500, Collin L. Walling wrote:
> 
> 
> On 11/28/2016 10:46 AM, Jiri Denemark wrote:
> > > +    if (!(cpu_props = virJSONValueObjectGetObject(cpu_model, "props")))
> > I believe this should be
> > 
> >      if (!(cpu_props = virJSONValueObjectGetArray(cpu_model, "props")))
> The JSON data returned by query-cpu-model-expansion doesn't seem to
> use an array to represent the props data. The props are returned as
> key-value pairs.

Oops, sorry about it. You could use our foreach helper (I'm ignoring any
error checking here, but you shouldn't ignore it :-)):

    cpu_props = virJSONValueObjectGetObject(cpu_model, "props");
    virJSONValueObjectForeachKeyValue(cpu_props, ...);

Jirka




More information about the libvir-list mailing list