[libvirt] [PATCH v6 2/9] util: add functions for interating over json object

Dmitry Guryanov dguryanov at parallels.com
Thu May 3 18:10:56 UTC 2012


On 05/03/2012 07:08 PM, Eric Blake wrote:
> On 05/03/2012 04:10 AM, Daniel P. Berrange wrote:
>> On Wed, May 02, 2012 at 10:32:37PM +0400, Dmitry Guryanov wrote:
>>> Add function virJSONValueObjectKeysNumber, virJSONValueObjectGetKey
>>> and virJSONValueObjectGetValue, which allow you to iterate over all
>>> fields of json object: you can get number of fields and then get
>>> name and value, stored in field with that name by index.
>>>
>>> Signed-off-by: Dmitry Guryanov<dguryanov at parallels.com>
>>> +int virJSONValueObjectKeysNumber(virJSONValuePtr object);
>>> +const char *virJSONValueObjectGetKey(virJSONValuePtr object, unsigned int n);
>>> +virJSONValuePtr virJSONValueObjectGetValue(virJSONValuePtr object, unsigned int n);
>>> +
>>>   const char *virJSONValueGetString(virJSONValuePtr object);
>>>   int virJSONValueGetNumberInt(virJSONValuePtr object, int *value);
>>>   int virJSONValueGetNumberUint(virJSONValuePtr object, unsigned int *value);
>> ACK to adding this API to GIT now, regardless of the other patches
>>
>> Though having said that when pushing, we should be sure to add the
>> 3 new symbols to libvirt_private.syms
> I added that, and pushed this patch.
>
> I agree with the decision to hold off on the rest of the series until
> after the actual hypervisor is available to target.
>
OK, but could you please review patches with the storage driver and
virDomainDefineXML implementation ? I want to continue to work, but
not sure, that it's the right way.

-- 
Dmitry Guryanov




More information about the libvir-list mailing list