1. 21 9月, 2015 3 次提交
  2. 15 9月, 2015 2 次提交
  3. 04 9月, 2015 11 次提交
  4. 18 6月, 2015 8 次提交
  5. 15 5月, 2015 14 次提交
  6. 06 5月, 2015 2 次提交
    • E
      qapi: Check for member name conflicts with a base class · ff55d72e
      Eric Blake 提交于
      Our type inheritance for both 'struct' and for flat 'union' merges
      key/value pairs from the base class with those from the type in
      question.  Although the C code currently boxes things so that there
      is a distinction between which member is referred to, the QMP wire
      format does not allow passing a key more than once in a single
      object.  Besides, if we ever change the generated C code to not be
      quite so boxy, we'd want to avoid duplicate member names there,
      too.
      
      Fix a testsuite entry added in an earlier patch, as well as adding
      a couple more tests to ensure we have appropriate coverage.  Ensure
      that collisions are detected, regardless of whether there is a
      difference in opinion on whether the member name is optional.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      ff55d72e
    • E
      qapi: Support (subset of) \u escapes in strings · a7f5966b
      Eric Blake 提交于
      The handling of \ inside QAPI strings was less than ideal, and
      really only worked JSON's \/, \\, \", and our extension of \'
      (an obvious extension, when you realize we use '' instead of ""
      for strings).  For other things, like '\n', it resulted in a
      literal 'n' instead of a newline.
      
      Of course, at the moment, we really have no use for escaped
      characters, as QAPI has to map to C identifiers, and we currently
      support ASCII only for that.  But down the road, we may add
      support for default values for string parameters to a command
      or struct; if that happens, it would be nice to correctly support
      all JSON escape sequences, such as \n or \uXXXX.  This gets us
      closer, by supporting Unicode escapes in the ASCII range.
      
      Since JSON does not require \OCTAL or \xXX escapes, and our QMP
      implementation does not understand them either, I intentionally
      reject it here, but it would be an easy addition if we desired it.
      Likewise, intentionally refusing the NUL byte means we don't have
      to worry about C strings being shorter than the qapi input.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      a7f5966b