Skip to content
Snippets Groups Projects
  1. Jul 02, 2020
  2. Aug 15, 2018
  3. Jun 22, 2018
  4. Jun 15, 2018
  5. May 04, 2018
  6. Mar 19, 2018
    • Hanna Reitz's avatar
      qapi: Replace qobject_to_X(o) by qobject_to(X, o) · 7dc847eb
      Hanna Reitz authored
      
      This patch was generated using the following Coccinelle script:
      
      @@
      expression Obj;
      @@
      (
      - qobject_to_qnum(Obj)
      + qobject_to(QNum, Obj)
      |
      - qobject_to_qstring(Obj)
      + qobject_to(QString, Obj)
      |
      - qobject_to_qdict(Obj)
      + qobject_to(QDict, Obj)
      |
      - qobject_to_qlist(Obj)
      + qobject_to(QList, Obj)
      |
      - qobject_to_qbool(Obj)
      + qobject_to(QBool, Obj)
      )
      
      and a bit of manual fix-up for overly long lines and three places in
      tests/check-qjson.c that Coccinelle did not find.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
      Message-Id: <20180224154033.29559-4-mreitz@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      [eblake: swap order from qobject_to(o, X), rebase to master, also a fix
      to latent false-positive compiler complaint about hw/i386/acpi-build.c]
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      7dc847eb
  7. Mar 09, 2018
  8. Feb 09, 2018
  9. Jun 20, 2017
  10. May 09, 2017
  11. May 08, 2017
  12. Feb 22, 2017
  13. Oct 25, 2016
    • Daniel P. Berrangé's avatar
      qdict: implement a qdict_crumple method for un-flattening a dict · 603476c2
      Daniel P. Berrangé authored
      
      The qdict_flatten() method will take a dict whose elements are
      further nested dicts/lists and flatten them by concatenating
      keys.
      
      The qdict_crumple() method aims to do the reverse, taking a flat
      qdict, and turning it into a set of nested dicts/lists. It will
      apply nesting based on the key name, with a '.' indicating a
      new level in the hierarchy. If the keys in the nested structure
      are all numeric, it will create a list, otherwise it will create
      a dict.
      
      If the keys are a mixture of numeric and non-numeric, or the
      numeric keys are not in strictly ascending order, an error will
      be reported.
      
      As an example, a flat dict containing
      
       {
         'foo.0.bar': 'one',
         'foo.0.wizz': '1',
         'foo.1.bar': 'two',
         'foo.1.wizz': '2'
       }
      
      will get turned into a dict with one element 'foo' whose
      value is a list. The list elements will each in turn be
      dicts.
      
       {
         'foo': [
           { 'bar': 'one', 'wizz': '1' },
           { 'bar': 'two', 'wizz': '2' }
         ],
       }
      
      If the key is intended to contain a literal '.', then it must
      be escaped as '..'. ie a flat dict
      
        {
           'foo..bar': 'wizz',
           'bar.foo..bar': 'eek',
           'bar.hello': 'world'
        }
      
      Will end up as
      
        {
           'foo.bar': 'wizz',
           'bar': {
              'foo.bar': 'eek',
              'hello': 'world'
           }
        }
      
      The intent of this function is that it allows a set of QemuOpts
      to be turned into a nested data structure that mirrors the nesting
      used when the same object is defined over QMP.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1475246744-29302-3-git-send-email-berrange@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      [Parameter recursive dropped along with its tests; whitespace style
      touched up]
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      603476c2
  14. Jun 07, 2016
  15. Feb 16, 2016
  16. Jun 12, 2015
  17. May 19, 2014
  18. Feb 21, 2014
  19. Jan 22, 2014
  20. Dec 19, 2012
  21. Mar 30, 2012
  22. Jan 12, 2012
  23. Aug 21, 2011
  24. Feb 20, 2011
  25. Jul 01, 2010
Loading