)]}'
{
  "commit": "82ca8e469666b169ccf818a0e36136aee97d7db0",
  "tree": "9ad70840241a6e70afb3a2b0784ce546b810ba59",
  "parents": [
    "1f35334489a43800df4d20cd91362a87cee39a29"
  ],
  "author": {
    "name": "Eric Blake",
    "email": "eblake@redhat.com",
    "time": "Tue Sep 29 16:21:14 2015 -0600"
  },
  "committer": {
    "name": "Markus Armbruster",
    "email": "armbru@redhat.com",
    "time": "Mon Oct 12 18:46:50 2015 +0200"
  },
  "message": "qapi: Share gen_visit_fields()\n\nConsolidate the code between visit, command marshalling, and\nevent generation that iterates over the members of a struct.\nIt reduces code duplication in the generator, so that a future\npatch can reduce the size of generated code while touching only\none instead of three locations.\n\nThere are no changes to the generated marshal code.\n\nThe visitor code becomes slightly more verbose, but remains\nsemantically equivalent, and is actually easier to read as\nit follows a more common idiom:\n\n|     visit_optional(v, \u0026(*obj)-\u003ehas_device, \"device\", \u0026err);\n|-    if (!err \u0026\u0026 (*obj)-\u003ehas_device) {\n|-        visit_type_str(v, \u0026(*obj)-\u003edevice, \"device\", \u0026err);\n|-    }\n|     if (err) {\n|         goto out;\n|     }\n|+    if ((*obj)-\u003ehas_device) {\n|+        visit_type_str(v, \u0026(*obj)-\u003edevice, \"device\", \u0026err);\n|+        if (err) {\n|+            goto out;\n|+        }\n|+    }\n\nThe event code becomes slightly more verbose, but this is\narguably a bug fix: although the visitors are not well\ndocumented, use of an optional member should not be attempted\nunless guarded by a prior call to visit_optional().  Works only\nbecause the output qmp visitor has a no-op visit_optional():\n\n|+    visit_optional(v, \u0026has_offset, \"offset\", \u0026err);\n|+    if (err) {\n|+        goto out;\n|+    }\n|     if (has_offset) {\n|         visit_type_int(v, \u0026offset, \"offset\", \u0026err);\n\nSigned-off-by: Eric Blake \u003ceblake@redhat.com\u003e\nMessage-Id: \u003c1443565276-4535-17-git-send-email-eblake@redhat.com\u003e\nSigned-off-by: Markus Armbruster \u003carmbru@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4e99c1de8b76c005a4cf8330f70baea6a426f101",
      "old_mode": 33188,
      "old_path": "scripts/qapi-commands.py",
      "new_id": "9d214a6609013d77e913981f9775001ff934d6e7",
      "new_mode": 33188,
      "new_path": "scripts/qapi-commands.py"
    },
    {
      "type": "modify",
      "old_id": "eaaac05154084a1225c5e23ea8a6f2d44c5ccd84",
      "old_mode": 33188,
      "old_path": "scripts/qapi-event.py",
      "new_id": "720486f06c90e68a25dc74bff61955411eb33e16",
      "new_mode": 33188,
      "new_path": "scripts/qapi-event.py"
    },
    {
      "type": "modify",
      "old_id": "bc6911f8fe928e0d1ba20fb8c48ad68fa08756e4",
      "old_mode": 33188,
      "old_path": "scripts/qapi-visit.py",
      "new_id": "4f977813484310d34c22942e543116d8d790124f",
      "new_mode": 33188,
      "new_path": "scripts/qapi-visit.py"
    },
    {
      "type": "modify",
      "old_id": "62a415ccd9ef0ff9ff08198f0e15de0dce9dcc67",
      "old_mode": 33188,
      "old_path": "scripts/qapi.py",
      "new_id": "ada6380db259ac98ec3e4bdc31a071c3d760bcf0",
      "new_mode": 33188,
      "new_path": "scripts/qapi.py"
    }
  ]
}
