1. 19 5月, 2014 1 次提交
  2. 25 4月, 2014 1 次提交
  3. 22 2月, 2014 1 次提交
    • M
      qdict: Extract non-QDicts in qdict_array_split() · bae3f92a
      Max Reitz 提交于
      Currently, qdict_array_split() only splits off entries with a key prefix
      of "%u.", packing them into a new QDict. This patch makes it support
      entries with the plain key "%u" as well, directly putting them into the
      new QList without creating a QDict.
      
      If there is both an entry with a key of "%u" and other entries with keys
      prefixed "%u." (for the same index), the function simply terminates.
      
      To do this, this patch also adds a static function which tests whether a
      given QDict contains any keys with the given prefix. This is used to test
      whether entries with a key prefixed "%u." do exist in the source QDict
      without modifying it.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      bae3f92a
  4. 22 1月, 2014 2 次提交
  5. 07 1月, 2014 1 次提交
  6. 03 12月, 2013 1 次提交
  7. 29 11月, 2013 2 次提交
  8. 25 9月, 2013 1 次提交
  9. 27 7月, 2013 2 次提交
    • K
      Implement qdict_flatten() · f660dc6a
      Kevin Wolf 提交于
      qdict_flatten(): For each nested QDict with key x, all fields with key y
      are moved to this QDict and their key is renamed to "x.y". This operation
      is applied recursively for nested QDicts.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      f660dc6a
    • K
      qapi: Anonymous unions · 69dd62df
      Kevin Wolf 提交于
      The discriminator for anonymous unions is the data type. This allows to
      have a union type that allows both of these:
      
          { 'file': 'my_existing_block_device_id' }
          { 'file': { 'filename': '/tmp/mydisk.qcow2', 'read-only': true } }
      
      Unions like this are specified in the schema with an empty dict as
      discriminator. For this example you could take:
      
          { 'union': 'BlockRef',
            'discriminator': {},
            'data': { 'definition': 'BlockOptions',
                      'reference': 'str' } }
          { 'type': 'ExampleObject',
            'data: { 'file': 'BlockRef' } }
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      69dd62df
  10. 23 5月, 2013 1 次提交
  11. 14 4月, 2013 1 次提交
    • M
      qjson: to_json() case QTYPE_QSTRING is buggy, rewrite · e2ec3f97
      Markus Armbruster 提交于
      Known bugs in to_json():
      
      * A start byte for a three-byte sequence followed by less than two
        continuation bytes is split into one-byte sequences.
      
      * Start bytes for sequences longer than three bytes get misinterpreted
        as start bytes for three-byte sequences.  Continuation bytes beyond
        byte three become one-byte sequences.
      
        This means all characters outside the BMP are decoded incorrectly.
      
      * One-byte sequences with the MSB are put into the JSON string
        verbatim when char is unsigned, producing invalid UTF-8.  When char
        is signed, they're replaced by "\\uFFFF" instead.
      
        This includes \xFE, \xFF, and stray continuation bytes.
      
      * Overlong sequences are happily accepted, unless screwed up by the
        bugs above.
      
      * Likewise, sequences encoding surrogate code points or noncharacters.
      
      * Unlike other control characters, ASCII DEL is not escaped.  Except
        in overlong encodings.
      
      My rewrite fixes them as follows:
      
      * Malformed UTF-8 sequences are replaced.
      
        Except the overlong encoding \xC0\x80 of U+0000 is still accepted.
        Permits embedding NUL characters in C strings.  This trick is known
        as "Modified UTF-8".
      
      * Sequences encoding code points beyond Unicode range are replaced.
      
      * Sequences encoding code points beyond the BMP produce a surrogate
        pair.
      
      * Sequences encoding surrogate code points are replaced.
      
      * Sequences encoding noncharacters are replaced.
      
      * ASCII DEL is now always escaped.
      
      The replacement character is U+FFFD.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      e2ec3f97
  12. 05 4月, 2013 1 次提交
  13. 15 3月, 2013 1 次提交
  14. 13 1月, 2013 1 次提交