)]}'
{
  "commit": "b807a1e1e3796adaf3ece2f7b69ea5ee28468ff4",
  "tree": "12de63c62e22824e86aa3a4a6d3d103d29172760",
  "parents": [
    "14ff84619c6bb9b729dbf8b127c1e4c56ed8c500"
  ],
  "author": {
    "name": "Eric Blake",
    "email": "eblake@redhat.com",
    "time": "Wed Nov 18 01:52:46 2015 -0700"
  },
  "committer": {
    "name": "Markus Armbruster",
    "email": "armbru@redhat.com",
    "time": "Thu Dec 17 08:21:26 2015 +0100"
  },
  "message": "qapi: Check for QAPI collisions involving variant members\n\nRight now, our ad hoc parser ensures that we cannot have a\nflat union that introduces any members that would clash with\nnon-variant members inherited from the union\u0027s base type (see\nflat-union-clash-member.json).  We want QAPISchemaObjectType.check()\nto make the same check, so we can later reduce some of the ad\nhoc checks.\n\nWe already have a map \u0027seen\u0027 of all non-variant members. We\nstill need to check for collisions between each variant type\u0027s\nmembers and the non-variant ones.\n\nTo know the variant type\u0027s members, we need to call\nvariant.type.check().  This also detects when a type contains\nitself in a variant, exactly like the existing base.check()\ndetects when a type contains itself as a base.  (Except that\nwe currently forbid anything but a struct as the type of a\nvariant, so we can\u0027t actually trigger this type of loop yet.)\n\nSlight complication: an alternate\u0027s variant can have arbitrary\ntype, but only an object type\u0027s check() may be called outside\nQAPISchema.check(). We could either skip the call for variants\nof alternates, or skip it for non-object types.  For now, do\nthe latter, because it\u0027s easier.\n\nThen we call each variant member\u0027s check_clash() with the\nappropriate \u0027seen\u0027 map.  Since members of different variants\ncan\u0027t clash, we have to clone a fresh seen for each variant.\nWrap this in a new helper method\nQAPISchemaObjectTypeVariants.check_clash().\n\nNote that cloning \u0027seen\u0027 inside .check_clash() resembles\nthe one we just removed from .check() in \u0027qapi: Drop\nobsolete tag value collision assertions\u0027; the difference here is\nthat we are now checking for clashes among the qapi members of\nthe variant type, rather than for a single clash with the variant\ntag name itself.\n\nNote that, by construction, collisions can\u0027t actually happen for\nsimple unions: each variant\u0027s type is a wrapper with a single\nmember \u0027data\u0027, which will never collide with the only non-variant\nmember \u0027type\u0027.\n\nFor alternates, there\u0027s nothing for a variant object type\u0027s\nmembers to clash with, and therefore no need to call the new\nvariants.check_clash().\n\nNo change to generated code.\n\nSigned-off-by: Eric Blake \u003ceblake@redhat.com\u003e\nMessage-Id: \u003c1447836791-369-12-git-send-email-eblake@redhat.com\u003e\n[Commit message tweaked]\nSigned-off-by: Markus Armbruster \u003carmbru@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c6cb17b14a7021fc6bc5a7ae7c7d3b85b73aad9c",
      "old_mode": 33188,
      "old_path": "scripts/qapi.py",
      "new_id": "b2d071f92d94c98789ec7a9ed8f7bdb8816a2a3e",
      "new_mode": 33188,
      "new_path": "scripts/qapi.py"
    }
  ]
}
