1. 15 10月, 2019 2 次提交
  2. 18 7月, 2019 1 次提交
  3. 19 6月, 2019 1 次提交
  4. 10 4月, 2019 2 次提交
  5. 03 4月, 2019 1 次提交
  6. 08 2月, 2019 1 次提交
  7. 25 1月, 2019 1 次提交
  8. 14 12月, 2018 2 次提交
  9. 13 8月, 2018 1 次提交
  10. 18 7月, 2018 1 次提交
  11. 14 7月, 2018 1 次提交
  12. 11 5月, 2018 1 次提交
    • J
      util: Clean up consumers of virJSONValueArraySize · 4a3d6ed5
      John Ferlan 提交于
      Rather than have virJSONValueArraySize return a -1 when the input
      is not an array and then splat an error message, let's check for
      an array before calling and then change the return to be a size_t
      instead of ssize_t.
      
      That means using the helper virJSONValueIsArray as well as using a
      more generic error message such as "Malformed <something> array".
      In some cases we can remove stack variables and when we cannot,
      those variables should be size_t not ssize_t. Alter a few references
      of if (!value) to be if (value == 0) instead as well.
      
      Some callers can already assume an array is being worked on based
      on the previous call, so there's less to do.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      4a3d6ed5
  13. 17 4月, 2018 1 次提交
  14. 03 4月, 2018 2 次提交
  15. 23 3月, 2018 1 次提交
  16. 31 1月, 2018 1 次提交
  17. 11 7月, 2017 2 次提交
  18. 27 3月, 2017 1 次提交
  19. 18 1月, 2017 1 次提交
  20. 14 12月, 2016 1 次提交
  21. 09 11月, 2016 1 次提交
  22. 05 10月, 2016 1 次提交
    • J
      util: Introduce virJSONValueObjectStealArray · ebf8b783
      John Ferlan 提交于
      Provide the Steal API for any code paths that will desire to grab the
      object array and then free it afterwards rather than relying to freeing
      the whole chain from the reply.
      ebf8b783
  23. 27 7月, 2016 2 次提交
  24. 09 10月, 2015 1 次提交
    • M
      virJSONValueArraySize: return ssize_t · 4f77c48c
      Michal Privoznik 提交于
      The internal representation of a JSON array counts the items in
      size_t. However, for some reason, when asking for the count it's
      reported as int. Firstly, we need the function to return a signed
      type as it's returning -1 on an error. But, not every system has
      integer the same size as size_t. Therefore, lets return ssize_t.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4f77c48c
  25. 23 6月, 2015 1 次提交
    • E
      json: make it easier to type-check when getting from object · 58fd6703
      Eric Blake 提交于
      While working in qemu_monitor_json, I repeatedly found myself
      getting a value then checking if it was an object.  Add some
      wrappers to make this task easier.
      
      * src/util/virjson.c (virJSONValueObjectGetByType)
      (virJSONValueObjectGetObject, virJSONValueObjectGetArray): New
      functions.
      (virJSONValueObjectGetString, virJSONValueObjectGetNumberInt)
      (virJSONValueObjectGetNumberUint)
      (virJSONValueObjectGetNumberLong)
      (virJSONValueObjectGetNumberUlong)
      (virJSONValueObjectGetNumberDouble)
      (virJSONValueObjectGetBoolean): Simplify.
      (virJSONValueIsNull): Change return type.
      * src/util/virjson.h: Reflect changes.
      * src/libvirt_private.syms (virjson.h): Export them.
      * tests/jsontest.c (testJSONLookup): New test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      58fd6703
  26. 11 6月, 2015 1 次提交
  27. 31 1月, 2015 3 次提交
  28. 23 1月, 2015 1 次提交
  29. 15 10月, 2014 1 次提交
    • P
      util: json: Split out code to create json value objects · 881c4659
      Peter Krempa 提交于
      Our qemu monitor code has a converter from key-value pairs to a json
      value object. I want to re-use the code later and having it part of the
      monitor command generator is inflexible. Split it out into a separate
      helper.
      881c4659
  30. 17 6月, 2014 1 次提交
  31. 14 5月, 2013 1 次提交
    • E
      json: support removing a value from an object · 547a7c77
      Eric Blake 提交于
      In an upcoming patch, I need the way to safely transfer a nested
      virJSON object out of its parent container for independent use,
      even after the parent is freed.
      
      * src/util/virjson.h (virJSONValueObjectRemoveKey): New function.
      (_virJSONObject, _virJSONArray): Use correct type.
      * src/util/virjson.c (virJSONValueObjectRemoveKey): Implement it.
      * src/libvirt_private.syms (virjson.h): Export it.
      * tests/jsontest.c (mymain): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      547a7c77
  32. 21 12月, 2012 1 次提交