1. 03 4月, 2019 6 次提交
  2. 25 1月, 2019 2 次提交
    • E
      virjson: add convenience wrapper for appending string to array · 484370dc
      Eric Blake 提交于
      Upcoming patches need an array of strings for use in QMP
      block-dirty-bitmap-merge.  A convenience wrapper cuts down
      on the verbosity of creating the array, similar to the
      existing virJSONValueObjectAppendString().
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      484370dc
    • E
      virjson: always raise vir error on append failures · 4ea5a41e
      Eric Blake 提交于
      A function that returns -1 for multiple possible failures, but only
      raises a libvirt error for some of those failures, can be hard to
      use correctly. Yet both of our JSON object/array appenders fall in
      that pattern.  True, the silent errors represent coding bugs that
      none of the callers should ever trigger, while the noisy errors
      represent memory failures that can happen anywhere, so we happened
      to never end up failing without an error. But it is better to
      either use the _QUIET memory allocation variants, and make callers
      decide to report failure; or make all failure paths noisy. This
      patch takes the latter approach.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      4ea5a41e
  3. 24 9月, 2018 1 次提交
  4. 28 8月, 2018 1 次提交
  5. 13 8月, 2018 4 次提交
  6. 01 8月, 2018 1 次提交
    • D
      util: avoid symbol clash between json libraries · ce3c6ef6
      Daniel P. Berrangé 提交于
      The jansson and json-glib libraries both export symbols with a json_
      name prefix and json_object_iter_next() clashes between them.
      
      Unfortunately json-glib is linked in by GTK, so any app using GTK and
      libvirt will get a clash, resulting in SEGV. This also affects the NSS
      module provided by libvirt
      
      Instead of directly linking to jansson, use dlopen() with the RTLD_LOCAL
      flag which allows us to hide the symbols from the application that loads
      libvirt or the NSS module.
      
      Some preprocessor black magic and wrapper functions are used to redirect
      calls into the dlopen resolved symbols.
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      ce3c6ef6
  7. 18 7月, 2018 3 次提交
  8. 14 7月, 2018 3 次提交
  9. 11 5月, 2018 2 次提交
    • J
      virJSONValue: remove unused 'protect' property · 50b4e9af
      Ján Tomko 提交于
      The last usage was removed by commit <167028e3>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      50b4e9af
    • 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
  10. 17 4月, 2018 1 次提交
  11. 03 4月, 2018 3 次提交
  12. 23 3月, 2018 1 次提交
  13. 31 1月, 2018 1 次提交
  14. 11 7月, 2017 5 次提交
  15. 27 3月, 2017 1 次提交
  16. 18 1月, 2017 1 次提交
  17. 14 12月, 2016 1 次提交
  18. 09 11月, 2016 1 次提交
  19. 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
  20. 27 7月, 2016 1 次提交